');
var nonce=jQuery('#wprentals_update_profile_nonce').val();
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_ajax_update_profile',
'firstname':firstname,
'secondname':secondname,
'useremail':useremail,
'userphone':userphone,
'usermobile':usermobile,
'userskype':userskype,
'description':description,
'upload_picture':upload_picture,
'security-profile':securityprofile,
'profile_image_url':profile_image_url,
'profile_image_url_small':profile_image_url_small,
'user_id_url':useridurl,
'user_id_image_id':useridimageid,
'userfacebook':userfacebook,
'usertwitter':usertwitter,
'userlinkedin':userlinkedin,
'userpinterest':userpinterest,
'live_in':live_in,
'i_speak':i_speak,
'paypal_payments_to': paypal_payments_to,
'payment_info':payment_info,
'security':nonce,
'instagram':instagram,
'youtube':youtube,
'userwebsite':userwebsite,
},
success: function (data){
$('#profile_message').empty().append('
' + data + '
');
},
error: function (errorThrown){
}});
});
$('#delete_profile').on('click',function (){
var ajaxurl;
ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php';
var result=confirm(ajaxcalls_vars.delete_account);
if(result){
var nonce=jQuery('#wprentals_update_profile_nonce').val();
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_delete_profile',
'security':nonce
},
success: function (data){
window.location='/';
},
error: function (errorThrown){
}});
}});
});
wprentals_map_type=parseInt(mapbase_vars.wprentals_map_type);
var lealet_map_move_on_hover=0;
var propertyMarker_submit='';
var leaflet_map_move_flag=0;
function wprentals_map_general_start_map(page_map){
"use strict";
var zoom_level;
if(page_map=='prop'){
zoom_level=parseInt(googlecode_property_vars.page_custom_zoom, 10);
}else{
zoom_level=parseInt(googlecode_regular_vars.page_custom_zoom, 10);
}
if(wprentals_map_type===1){
wprentals_google_start_map(zoom_level);
}else if(wprentals_map_type===2){
wprentals_leaflet_start_map(zoom_level);
}else if(wprentals_map_type===3){
}}
function wprentals_map_general_set_markers(map, markers){
"use strict";
wprentals_google_setMarkers2(map, markers);
}
function wprentals_map_general_cluster(){
"use strict";
if(wprentals_map_type===1){
wprentals_google_map_cluster();
}else if(wprentals_map_type===2){
wprentals_leaflet_map_cluster();
}else if(wprentals_map_type===3){
}}
function wprentals_leaflet_map_cluster(){
"use strict";
map.addLayer(markers_cluster);
}
function wprentals_map_general_fit_to_bounds(){
"use strict";
if(wprentals_map_type===1){
wprentals_google_fit_to_bounds();
}else if(wprentals_map_type===2){
wprentals_leaflet_fit_to_bounds();
}else if(wprentals_map_type===3){
}}
function wprentals_map_general_map_pan_move(){
"use strict";
if(wprentals_map_type===1){
wprentals_google_map_pan_move();
}else if(wprentals_map_type===2){
wprentals_leaflet_map_pan_move();
}else if(wprentals_map_type===3){
}}
function wprentals_leaflet_start_map(zoom_level){
"use strict";
if(typeof(curent_gview_long)==='undefined'||curent_gview_lat===''||curent_gview_long==='0'){
if(typeof(googlecode_property_vars)!=='undefined'){
curent_gview_lat=googlecode_property_vars.general_latitude;
}
if(typeof(googlecode_regular_vars)!=='undefined'){
curent_gview_lat=googlecode_regular_vars.general_latitude;
}}
if(typeof(curent_gview_long)==='undefined'||curent_gview_long===''||curent_gview_long==='0'){
if(typeof(googlecode_property_vars)!=='undefined'){
curent_gview_long=googlecode_property_vars.general_longitude;
}
if(typeof(googlecode_regular_vars)!=='undefined'){
curent_gview_long=googlecode_regular_vars.general_longitude;
}}
var mapCenter=L.latLng(curent_gview_lat,curent_gview_long);
if(document.getElementById('googleMap')){
map=L.map('googleMap',{
center: mapCenter,
zoom: zoom_level,
}).on('load', function(e){
jQuery('#gmap-loading').remove();
});
}else if(document.getElementById('google_map_prop_list')){
map=L.map('google_map_prop_list',{
center: mapCenter,
zoom: zoom_level
}).on('load', function(e){
jQuery('#gmap-loading').remove();
});
}else if(document.getElementById('google_map_on_list')){
map=L.map('google_map_on_list',{
center: mapCenter,
zoom: zoom_level
}).on('load', function(e){
jQuery('#gmap-loading').remove();
});
map_intern=1;
}
var tileLayer=wprentals_open_stret_tile_details();
map.addLayer(tileLayer);
map.scrollWheelZoom.disable();
if(Modernizr.mq('only all and (max-width: 768px)')){
map.dragging.disable();
}
map.on('popupopen', function(e){
lealet_map_move_on_hover=1;
if(jQuery('#google_map_prop_list_wrapper').length==0){
var px=map.project(e.popup._latlng);
if(mapfunctions_vars.useprice==='yes'){
px.y -=115;
}else{
px.y -=320/2;
}
map.panTo(map.unproject(px),{animate: true});
}
lealet_map_move_on_hover=1;
});
map.on('load', function(e){
jQuery('#gmap-loading').remove();
});
if(Modernizr.mq('only all and (max-width: 768px)')){
map.on('dblclick ', function(e){
if(map.dragging.enabled()){
map.dragging.disable();
}else{
map.dragging.enable();
}});
}
markers_cluster=L.markerClusterGroup({
iconCreateFunction: function(cluster){
return L.divIcon({ html: '
' + cluster.getChildCount() + '
' });
},
});
}
function wprentals_open_stret_tile_details(){
"use strict";
if(mapbase_vars.wp_estate_mapbox_api_key===''){
var tileLayer=L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '©
OpenStreetMap contributors'
});
}else{
var tileLayer=L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token='+mapbase_vars.wp_estate_mapbox_api_key, {
attribution: '©
OpenStreetMap contributors',
maxZoom: 18,
id: 'mapbox.streets',
accessToken: 'your.mapbox.access.token'
}
);
}
return tileLayer;
}
function wprentals_google_start_map(zoom_level){
"use strict";
var mapOptions, styles;
if(typeof(curent_gview_long)==='undefined'||curent_gview_lat===''||curent_gview_lat==='0'){
if(typeof(googlecode_property_vars)!=='undefined'){
curent_gview_lat=googlecode_property_vars.general_latitude;
}
if(typeof(googlecode_regular_vars)!=='undefined'){
curent_gview_lat=googlecode_regular_vars.general_latitude;
}}
if(typeof(curent_gview_long)==='undefined'||curent_gview_long===''||curent_gview_long==='0'){
if(typeof(googlecode_property_vars)!=='undefined'){
curent_gview_long=googlecode_property_vars.general_longitude;
}
if(typeof(googlecode_regular_vars)!=='undefined'){
curent_gview_long=googlecode_regular_vars.general_longitude;
}}
mapOptions={
flat: false,
noClear: false,
zoom: zoom_level,
scrollwheel: false,
draggable: true,
maxZoom:18,
center: new google.maps.LatLng(curent_gview_lat, curent_gview_long),
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false,
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP]
},
disableDefaultUI: true,
gestureHandling: 'cooperative'
};
if(document.getElementById('googleMap')){
map=new google.maps.Map(document.getElementById('googleMap'), mapOptions);
}else if(document.getElementById('google_map_prop_list')){
mapOptions['minZoom']=4;
map=new google.maps.Map(document.getElementById('google_map_prop_list'), mapOptions);
}else if(document.getElementById('google_map_on_list')){
map=new google.maps.Map(document.getElementById('google_map_on_list'), mapOptions);
map_intern=1;
}else{
return;
}
bounds_list=new google.maps.LatLngBounds();
google.maps.visualRefresh=true;
if(mapfunctions_vars.map_style!==''){
styles=JSON.parse(mapfunctions_vars.map_style);
map.setOptions({styles: styles});
}
google.maps.event.addListener(map, 'tilesloaded', function (){
jQuery('#gmap-loading').remove();
});
google.maps.event.addListener(map, 'tilesloaded', function (){
jQuery('#gmap-loading').remove();
});
if(Modernizr.mq('only all and (max-width: 1025px)')){
map.setOptions({'draggable': false});
}
if(document.getElementById('googleMap')){
google.maps.event.addDomListener(document.getElementById('googleMap'), 'mousewheel', scrollwhel);
google.maps.event.addDomListener(document.getElementById('googleMap'), 'DOMMouseScroll', scrollwhel);
}
if(document.getElementById('google_map_prop_list')){
google.maps.event.addDomListener(document.getElementById('google_map_prop_list'), 'mousewheel', scrollwhel);
google.maps.event.addDomListener(document.getElementById('google_map_prop_list'), 'DOMMouseScroll', scrollwhel);
}
function scrollwhel(event){
if(map.scrollwheel===true){
event.stopPropagation();
}}
}
function wprentals_leaflet_fit_to_bounds(){
"use strict";
if(typeof(bounds_list)!='undefined'&&bounds_list.isValid()){
if(mapfunctions_vars.bypass_fit_bounds!=='1'){
wpestate_fit_bounds_leaflet(bounds_list);
}}else{
wpestate_fit_bounds_nolsit_leaflet();
}}
function wprentals_google_fit_to_bounds(){
"use strict";
if(document.getElementById('google_map_prop_list')){
if(!bounds_list.isEmpty()){
if(mapfunctions_vars.bypass_fit_bounds!=='1'){
wpestate_fit_bounds(bounds_list);
}}else{
wpestate_fit_bounds_nolsit();
}}else if(document.getElementById('googleMap')){
if(!bounds_list.isEmpty()){
if(mapfunctions_vars.bypass_fit_bounds!=='1'){
wpestate_fit_bounds(bounds_list);
}}else{
wpestate_fit_bounds_nolsit();
}}
}
function wprentals_map_general_spiderfy(){
"use strict";
if(wprentals_map_type===1){
oms=new OverlappingMarkerSpiderfier(map, {markersWontMove: true, markersWontHide: true, keepSpiderfied: true, legWeight: 3});
setOms(gmarkers);
}else if(wprentals_map_type===2){
}else if(wprentals_map_type===3){
}}
function wprentals_leaflet_map_pan_move(){
"use strict";
if(googlecode_regular_vars.on_demand_pins==='yes'&&mapfunctions_vars.is_tax!=1&&mapfunctions_vars.is_property_list==='1'){
map.on('moveend', function(e){
wpestate_ondenamd_map_moved_leaflet();
});
}}
function wprentals_google_map_pan_move(){
"use strict";
if(googlecode_regular_vars.on_demand_pins==='yes'&&mapfunctions_vars.is_tax!=1&&mapfunctions_vars.is_property_list==='1'){
map.addListener('idle', function(){
wpestate_ondenamd_map_moved();
});
}}
function wprentals_google_setMarkers2 (map, locations){
"use strict";
var selected_id=parseInt(jQuery('#gmap_wrapper').attr('data-post_id'), 10);
if(isNaN(selected_id)){
selected_id=parseInt(jQuery('#google_map_on_list').attr('data-post_id'), 10);
}
var open_height=parseInt(mapfunctions_vars.open_height, 10);
var closed_height=parseInt(mapfunctions_vars.closed_height, 10);
var width_browser=jQuery(window).width();
infobox_width=700;
vertical_pan=-215;
if(width_browser < 900){
infobox_width=500;
}
if(width_browser < 600){
infobox_width=400;
}
if(width_browser < 400){
infobox_width=200;
}
var i;
for (i=0; i < locations.length; i++){
var beach=locations[i];
var id=beach[10];
var lat=beach[1];
var lng=beach[2];
var title=decodeURIComponent(beach[0]);
var pin=beach[8];
var counter=beach[3];
var image=decodeURIComponent(beach[4]);
var price=decodeURIComponent(beach[5]);
var single_first_type=decodeURIComponent(beach[6]);
var single_first_action=decodeURIComponent(beach[7]);
var link=decodeURIComponent(beach[9]);
var city=decodeURIComponent(beach[11]);
var area=decodeURIComponent(beach[12]);
var cleanprice=beach[13];
var rooms=beach[14];
var baths=beach[15];
var size=beach[16];
var single_first_type_name=decodeURIComponent(beach[17]);
var single_first_action_name=decodeURIComponent(beach[18]);
var status=decodeURIComponent(beach[19]);
var pin_price=decodeURIComponent(beach[20]);
var custom_info=decodeURIComponent(beach[21]);
if(selected_id===id){
found_id=i;
}
if(wprentals_map_type===1){
wprentals_createMarker_google(pin_price,infobox_width ,size, i, id, lat, lng, pin, title, counter, image, price, single_first_type, single_first_action, link, city, area, rooms, baths, cleanprice, single_first_type_name, single_first_action_name,status,custom_info);
}else if(wprentals_map_type===2){
wprentals_createMarker_leaflet(pin_price,infobox_width ,size, i, id, lat, lng, pin, title, counter, image, price, single_first_type, single_first_action, link, city, area, rooms, baths, cleanprice, single_first_type_name, single_first_action_name,status,custom_info);
}else if(wprentals_map_type===3){
}}
}
function wprentals_createMarker_google(pin_price,infobox_width, size, i, id, lat, lng, pin, title, counter, image, price, single_first_type, single_first_action, link, city, area, rooms, baths, cleanprice, single_first_type_name, single_first_action_name,status,custom_info){
"use strict";
var marker, myLatLng;
var Titlex=jQuery('
').html(title).text();
var infobox_class="";
var poss=0;
var boxText=document.createElement("div");
var myOptions={
content: boxText,
disableAutoPan: true,
maxWidth: infobox_width,
boxClass: "mybox",
zIndex: null,
closeBoxMargin: "-13px 0px 0px 0px",
closeBoxURL: "",
infoBoxClearance: new google.maps.Size(1, 1),
isHidden: false,
pane: "floatPane",
enableEventPropagation: false
};
infoBox=new InfoBox(myOptions);
myLatLng=new google.maps.LatLng(lat, lng);
if(mapfunctions_vars.useprice==='yes'&&mapfunctions_vars.hidden_map){
infobox_class=" pin_price_info ";
var myLatlng=new google.maps.LatLng(lat,lng);
marker=new WpstateMarker(
area,
city,
pin_price,
poss,
myLatlng,
map,
Titlex,
counter,
image,
id,
price,
single_first_type,
single_first_action,
link,
i,
rooms,
baths,
cleanprice,
size,
single_first_type_name,
single_first_action_name,
pin,
custom_info
);
}else{
infobox_class=" classic_info ";
marker=new google.maps.Marker({
position: myLatLng,
map: map,
icon: custompin(pin),
custompin: pin,
shape: shape,
title: title,
zIndex: counter,
image: image,
idul: id,
price: price,
category: single_first_type,
action: single_first_action,
link: link,
city: city,
area: area,
infoWindowIndex: i,
rooms: rooms,
guest_no: baths,
cleanprice: cleanprice,
size: size,
category_name: single_first_type_name,
action_name: single_first_action_name,
status:status,
custom_info:custom_info
});
}
gmarkers.push(marker);
if(typeof (bounds_list)!=="undefined"){
bounds_list.extend(marker.getPosition());
}
google.maps.event.addListener(marker, 'click', function (event){
var title, info_image, category, action, category_name, action_name, in_type, infoguest, inforooms, vertical_off, status_html,status;
wpestate_new_open_close_map(1);
external_action_ondemand=1;
if(this.image===''){
info_image=mapfunctions_vars.path + '/idxdefault.jpg';
}else{
info_image=this.image;
}
if(typeof(this.status)!='undefined'){
if(this.status.indexOf('%')!==-1){
status=this.status;
}else{
status=decodeURIComponent(this.status.replace(/-/g, ' '));
}}else{
status='';
}
category=decodeURIComponent(this.category.replace(/-/g, ' '));
action=decodeURIComponent(this.action.replace(/-/g, ' '));
category_name=decodeURIComponent(this.category_name.replace(/-/g, ' '));
action_name=decodeURIComponent(this.action_name.replace(/-/g, ' '));
status_html=wpestate_display_status(status);
in_type=mapfunctions_vars.in_text;
if(category===''||action===''){
in_type=" ";
}
in_type=" / ";
if(this.guest_no!==''){
infoguest='
' + this.guest_no + ' ';
}else{
infoguest='';
}
if(this.rooms!==''){
inforooms='
' + this.rooms + ' ';
}else{
inforooms='';
}
title=this.title.toString();
if(this.custom_info!=='undefined'){
var custom_array=this.custom_info.split(',');
inforooms='
' + custom_array[1] + '';
infoguest='
' + custom_array[3] + '';
}
infoBox.setContent('
'+status_html+'
' + title + ' ' + category_name + " " + in_type + " " + action_name + '
' + infoguest + inforooms + '
' + this.price + '
');
if(mapfunctions_vars.hidden_map){
infoBox.open(map, this);
}
map.setCenter(this.position);
switch (infobox_width){
case 700:
if(!document.getElementById('google_map_on_list')){
if(mapfunctions_vars.listing_map==='top'){
if(document.getElementById('google_map_prop_list')){
map.panBy(0, -100);
}else{
map.panBy(100, -100);
}}else{
map.panBy(10, -110);
}}else{
if(mapfunctions_vars.hidden_map){
map.panBy(0, -160);
}}
vertical_off=0;
break;
case 500:
if(document.getElementById('google_map_prop_list')){
map.panBy(50, -120);
}else{
map.panBy(50, -150);
}
break;
case 400:
if(document.getElementById('google_map_prop_list')){
map.panBy(100, -220);
}else{
map.panBy(0, -150);
}
break;
case 200:
map.panBy(20, -170);
break;
}
if(control_vars.show_adv_search_map_close==='no'){
$('.search_wrapper').addClass('adv1_close');
adv_search_click();
}
wpestate_close_adv_search();
});/////////////////////////////////// end event listener
if(mapfunctions_vars.generated_pins!=='0'){
if(map_is_pan===0){
wpestate_pan_to_last_pin(myLatLng);
}
map_is_pan=1;
}}
function wprentals_createMarker_leaflet(pin_price,infobox_width, size, i, id, lat, lng, pin, title, counter, image, price, single_first_type, single_first_action, link, city, area, rooms, guest_no, cleanprice, single_first_type_name, single_first_action_name,status,custom_info){
"use strict";
var infoboxWrapper=document.createElement("div");
infoboxWrapper.className='leafinfobox-wrapper';
var infobox="";
var infobox_class=" classic_info ";
if(mapfunctions_vars.useprice==='yes'){
infobox_class=' openstreet_map_price_infobox ';
}
if(typeof(status)!='undefined'){
if(status.indexOf('%')!==-1){
}else{
status=decodeURIComponent(status.replace(/-/g, ' '));
}}else{
status='';
}
var status_html=wpestate_display_status(status);
var info_image='';
if(image===''){
info_image=mapfunctions_vars.path + '/idxdefault.jpg';
}else{
info_image=image;
}
var category=decodeURIComponent(single_first_type.replace(/-/g, ' '));
var action=decodeURIComponent(single_first_action.replace(/-/g, ' '));
var category_name=decodeURIComponent(single_first_type_name.replace(/-/g, ' '));
var action_name=decodeURIComponent(single_first_action_name.replace(/-/g, ' '));
var in_type=mapfunctions_vars.in_text;
if(category===''||action===''){
in_type=" ";
}
in_type=" / ";
var infoguest,inforooms;
if(guest_no!==''){
infoguest='
' + guest_no + ' ';
}else{
infoguest='';
}
if(rooms!==''){
inforooms='
' + rooms + ' ';
}else{
inforooms='';
}
title=title.toString();
if(custom_info!=='undefined'){
var custom_array=custom_info.split(',');
inforooms='
' + custom_array[1] + '';
infoguest='
' + custom_array[3] + '';
}
infobox +='
'+status_html+'
' + title + ' ' + category_name + " " + in_type + " " + action_name + '
' + infoguest + inforooms + '
' + price + '
';
var markerOptions={
riseOnHover: true
};
var markerCenter=L.latLng(lat, lng);
var propertyMarker='';
if(!mapfunctions_vars.hidden_map){
propertyMarker=L.circle(markerCenter, {
color: 'red',
fillColor: '#b881fc',
fillOpacity: 0.4,
strokeWeight: 0.4,
radius: 120
});
}else{
if(mapfunctions_vars.useprice==='yes'){
var price_pin_class='wpestate_marker openstreet_price_marker '+wpestate_makeSafeForCSS(single_first_type_name.trim())+' '+wpestate_makeSafeForCSS(single_first_action_name.trim());
var pin_price_marker='
';
if(typeof(price)!=='undefined'){
if(mapfunctions_vars.use_price_pins_full_price==='no'){
pin_price_marker +='
'+pin_price+'
';
}else{
pin_price_marker +='
'+price+'
';
}}
pin_price_marker +='
';
var myIcon=L.divIcon({
className:'someclass',
iconSize: new L.Point(0, 0),
html: pin_price_marker
});
propertyMarker=L.marker(markerCenter, {icon: myIcon});
}else{
var markerImage={
iconUrl: wprentals_custompin_leaflet(pin),
iconSize: [44, 50],
iconAnchor: [20, 50],
popupAnchor: [1, -50]
};
markerOptions.icon=L.icon(markerImage);
propertyMarker=L.marker(markerCenter, markerOptions);
}}
propertyMarker.idul=id;
propertyMarker.pin=pin;
if(mapfunctions_vars.user_cluster==='yes'){
markers_cluster.addLayer(propertyMarker);
}else{
propertyMarker.addTo(map);
}
gmarkers.push(propertyMarker);
if(typeof (bounds_list)!=="undefined"){
bounds_list.extend(propertyMarker.getLatLng());
}else{
bounds_list=L.latLngBounds(propertyMarker.getLatLng(),propertyMarker.getLatLng());
}
infoboxWrapper.innerHTML=infobox;
propertyMarker.bindPopup(infobox);
if(mapfunctions_vars.generated_pins!=='0'){
if(map_is_pan===0){
wpestate_pan_to_last_pin(markerCenter);
}
map_is_pan=1;
}}
function wprentals_custompinchild_leaflet(image){
"use strict";
var custom_img;
var extension='';
var ratio=jQuery(window).dense('devicePixelRatio');
if(ratio>1){
extension='_2x';
}
if(images['userpin']===''){
custom_img=mapfunctions_vars.path + '/' + 'userpin' +extension+ '.png';
}else{
custom_img=images['userpin'];
if(ratio>1){
custom_img=custom_img.replace(".png","_2x.png");
}}
return custom_img;
}
function wprentals_custompin_leaflet(image){
"use strict";
if(mapfunctions_vars.useprice==='yes'){
return mapfunctions_vars.path + '/pixel.png';
}
var custom_img='';
var extension='';
var ratio=jQuery(window).dense('devicePixelRatio');
if(ratio>1){
extension='_2x';
}
if(mapfunctions_vars.use_single_image_pin==='no'){
if(image!==''){
if(images[image]===''){
custom_img=mapfunctions_vars.path + '/' + image + extension + '.png';
}else{
custom_img=images[image];
if(ratio>1){
custom_img=wpestate_get_custom_retina_pin(custom_img);
}}
}else{
custom_img=images['single_pin'];
}}else{
if(ratio>1){
custom_img=wpestate_get_custom_retina_pin(images['single_pin']);
}else{
custom_img=images['single_pin'];
}}
return custom_img;
}
function wprentals_map_resize(){
"use strict";
if(wprentals_map_type===1){
google.maps.event.trigger(map, "resize");
}else if(wprentals_map_type===2){
map.invalidateSize();
}else if(wprentals_map_type===3){
}}
wprentals_autocomplete_mapbox();
function wprentals_autocomplete_mapbox(){
"use strict";
if(parseInt(mapbase_vars.wprentals_places_type)!==2){
return;
}
if(document.getElementById('property_city_front')){
if(parseInt(mapbase_vars.wprentals_places_type)==2){
var placesAutocomplete=places({
appId: mapbase_vars.wp_estate_algolia_app_id,
apiKey: mapbase_vars.wp_estate_algolia_api_key,
type: 'city',
language: 'en',
templates: {
value: function(suggestion){
return suggestion.name;
}},
container: document.querySelector('#property_city_front')
});
placesAutocomplete.on('change', function(e){
wprentals_agolia_fillInAddress_city(e);
});
}}
if(document.getElementById('property_address')){
var address, full_addr, country, city, infowindow;
address=document.getElementById('property_address').value;
city=jQuery("#property_city_submit").val();
full_addr=address + ',' + city;
country=document.getElementById('property_country').value;
if(country){
full_addr=full_addr + ',' + country;
}
var placesAutocomplete=places({
appId: mapbase_vars.wp_estate_algolia_app_id,
apiKey: mapbase_vars.wp_estate_algolia_api_key,
type: 'address',
language: 'en',
templates: {
value: function(suggestion){
return suggestion.name;
}},
container: document.querySelector('#property_address')
});
placesAutocomplete.on('change', function(place){
wprentals_submit_agolia_codeAddress(place.suggestion.latlng.lat,place.suggestion.latlng.lng);
});
}
if(document.getElementById('geolocation_search')){
var placesAutocomplete=places({
appId: mapbase_vars.wp_estate_algolia_app_id,
apiKey: mapbase_vars.wp_estate_algolia_api_key,
language: 'en',
templates: {
value: function(suggestion){
return suggestion.name;
}},
container: document.querySelector('#geolocation_search')
});
placesAutocomplete.on('change', function(place){
initial_geolocation_circle_flag=0;
jQuery("#geolocation_lat").val(place.suggestion.latlng.lat);
jQuery("#geolocation_long").val(place.suggestion.latlng.lng);
wpestate_start_filtering_ajax_map(1);
});
}
var search_fields=['search_location', 'search_locationshortcode', 'search_locationmobile','search_locationsidebar'];
search_fields.forEach(function(element){
if(document.getElementById(element)&&document.getElementById(element).getAttribute("type")=="text"){
var placesAutocomplete=places({
appId: mapbase_vars.wp_estate_algolia_app_id,
apiKey: mapbase_vars.wp_estate_algolia_api_key,
type: 'city',
language: 'en',
templates: {
value: function(suggestion){
return suggestion.name;
}},
container: document.querySelector('#'+element)
});
placesAutocomplete.on('change', function(place){
wprentals_fillInAddress_filter_leaflet(place,element);
});
}});
}
function wprentals_fillInAddress_filter_leaflet(place,element){
"use strict";
var i, addressType, val, have_city,admin_area,property_country,property_area,property_city;
have_city=0;
admin_area='';
var extension='';
if(element=='search_locationshortcode'){
extension='shortcode';
}else if(element=='search_locationmobile'){
extension='mobile';
}else if(element=='search_locationsidebar'){
extension='sidebar';
}
if(typeof(place.suggestion.administrative)!=='undefined'){
admin_area=admin_area+place.suggestion.administrative;
}
if(typeof(place.suggestion.county)!=='undefined'){
admin_area=admin_area+', '+place.suggestion.county;
}
jQuery('#property_admin_area,#property_admin_areasidebar,#property_admin_areashortcode,#property_admin_areamobile').val(admin_area);
if(typeof(place.suggestion.country)!=='undefined'){
property_country=place.suggestion.country;
jQuery('#advanced_country'+extension).attr('data-value', property_country);
jQuery('#advanced_country'+extension).val(property_country);
jQuery('#search_location_country'+extension).val(property_country);
}
if(place.suggestion.type=='city'){
property_city=place.suggestion.value;
jQuery('#advanced_city'+extension).attr('data-value', property_city);
jQuery('#advanced_city'+extension).val(property_city);
jQuery('#search_location_city'+extension).val(property_city);
}
if(place.suggestion.type=='address'){
property_area=place.suggestion.address;
jQuery('#advanced_area'+extension).attr('data-value', property_area);
jQuery('#advanced_area'+extension).val(property_area);
jQuery('#search_location_area'+extension).val(property_area);
}
if(jQuery('#advanced_search_map_list').length>0){
wpestate_start_filtering_ajax_map(1);
}
var is_google_map=parseFloat(jQuery('#isgooglemap').attr('data-isgooglemap'), 10);
if(is_google_map===1){
var guest_val=jQuery(this).attr('data-value');
}}
function wprentals_agolia_fillInAddress_city(place){
"use strict";
var admin_area='';
var property_city='';
var property_country='';
if(typeof(place.suggestion.administrative)!=='undefined'){
admin_area=admin_area+place.suggestion.administrative;
}
if(typeof(place.suggestion.county)!=='undefined'){
admin_area=admin_area+', '+place.suggestion.county;
}
if(typeof(place.suggestion.country)!=='undefined'){
property_country=place.suggestion.country;
}
if(typeof(place.suggestion.value)!=='undefined'){
property_city=place.suggestion.value;
}
jQuery('#property_city').val(property_city);
jQuery('#property_country').val(property_country);
jQuery('#property_admin_area').val(property_city+", "+admin_area);
}
function wprentals_initialize_map_submit_leaflet(){
"use strict";
var listing_lat=jQuery('#property_latitude').val();
var listing_lon=jQuery('#property_longitude').val();
if(listing_lat===''||listing_lat===0||listing_lat==='0'){
listing_lat=google_map_submit_vars.general_latitude;
}
if(listing_lon===''||listing_lon===0||listing_lon==='0'){
listing_lon=google_map_submit_vars.general_longitude;
}
var mapCenter=L.latLng(listing_lat,listing_lon);
if(document.getElementById('googleMapsubmit')){
map=L.map('googleMapsubmit',{
center: mapCenter,
zoom: 17
}).on('load', function(e){
});
var tileLayer=wprentals_open_stret_tile_details();
map.addLayer(tileLayer);
map.on('click', function(e){
map.removeLayer(propertyMarker_submit);
var markerCenter=L.latLng(e.latlng);
propertyMarker_submit=L.marker(e.latlng).addTo(map);
propertyMarker_submit.bindPopup('
Latitude: ' + e.latlng.lat + ' Longitude: ' + e.latlng.lng+'
').openPopup();
document.getElementById("property_latitude").value=e.latlng.lat ;
document.getElementById("property_longitude").value=e.latlng.lng;
});
var markerCenter=L.latLng(listing_lat,listing_lon);
propertyMarker_submit=L.marker(markerCenter).addTo(map);
propertyMarker_submit.bindPopup('
Latitude: ' + listing_lat + ' Longitude: ' + listing_lon+'
').openPopup();
}}
function wprentals_submit_agolia_codeAddress(listing_lat,listing_lon){
"use strict";
if(parseInt(mapbase_vars.wprentals_map_type)==1){
wprentals_submit_set_postion(listing_lat,listing_lon);
}else if(parseInt(mapbase_vars.wprentals_map_type)==2){
map.removeLayer(propertyMarker_submit);
var markerCenter=L.latLng(listing_lat,listing_lon);
propertyMarker_submit=L.marker(markerCenter).addTo(map);
map.setView(markerCenter, 15);
propertyMarker_submit.bindPopup('
Latitude: ' + listing_lat + ' Longitude: ' + listing_lon+'
').openPopup();
document.getElementById("property_latitude").value=listing_lat ;
document.getElementById("property_longitude").value=listing_lon;
}}
function wprentals_submit_set_postion(listing_lat,listing_long){
"use strict";
wpestate_removeMarkers();
var myLatLng=new google.maps.LatLng(listing_lat, listing_long);
map.setCenter(myLatLng);
var marker=new google.maps.Marker({
map: map,
position: myLatLng
});
gmarkers.push(marker);
var infowindow=new google.maps.InfoWindow({
content: 'Latitude: ' + listing_lat + '
Longitude: ' + listing_long
});
infowindow.open(map,marker);
document.getElementById("property_latitude").value=listing_lat ;
document.getElementById("property_longitude").value=listing_long;
}
function wpestate_display_status(status){
var status_html='';
if(status!=='normal'&&status!==''){
var status_array=status.split(",");
for (var i=0; i < status_array.length; i++){
status_html=status_html+'
'+status_array[i]+'
';
}}
return status_html='
'+status_html+'
';
};
var gmarkers=[];
var leafletMarkers;
var current_place=0;
var actions=[];
var categories=[];
var vertical_pan=-190;
var map_open=0;
var vertical_off=150;
var pins='';
var markers='';
var infoBox=null;
var category=null;
var width_browser=null;
var infobox_width=null;
var wraper_height=null;
var info_image=null;
var map;
var found_id;
var selected_id='';
var javamap;
var oms;
var external_action_ondemand=0;
var is_fit_bounds_zoom=0;
var map_geo_first_load=0;
var markers_cluster;
var is_drag_end=0;
var is_zoom_end=0;
var map_is_moved=0;
var map_is_pan=0;
function wprentals_initialize_map(){
"use strict";
if(!document.getElementById('googleMap')&&!document.getElementById('google_map_prop_list')&&!document.getElementById('google_map_on_list')){
return;
}
wprentals_map_general_start_map();
if(googlecode_regular_vars.generated_pins==='0'){
pins=googlecode_regular_vars.markers;
markers=jQuery.parseJSON(pins);
}else{
if(typeof (googlecode_regular_vars2.markers2)!=='undefined'&&googlecode_regular_vars2.markers2.length > 0){
pins=googlecode_regular_vars2.markers2;
markers=jQuery.parseJSON(pins);
}}
if(markers.length > 0){
wprentals_map_general_set_markers(map, markers);
}
wprentals_map_general_cluster();
wprentals_map_general_fit_to_bounds();
wprentals_map_general_spiderfy();
wprentals_map_general_map_pan_move();
}
function wpestate_ondenamd_map_moved_leaflet(){
"use strict";
if(map_geo_first_load===1&&is_fit_bounds_zoom===0&&external_action_ondemand==0){
if(lealet_map_move_on_hover==0){
map_is_moved=1;
map_is_pan=1;
wpestate_reload_pins_onmap(1);
}}
map_geo_first_load=1;
external_action_ondemand=0;
lealet_map_move_on_hover=0;
return;
}
function wpestate_ondenamd_map_moved(){
"use strict";
if(map_geo_first_load===1&&is_fit_bounds_zoom===0&&external_action_ondemand==0){
map_is_moved=1;
map_is_pan=1;
wpestate_reload_pins_onmap(1);
}
map_geo_first_load=1;
external_action_ondemand=0;
return;
}
if(typeof google==='object'&&typeof google.maps==='object'){
google.maps.event.addDomListener(window, 'load', wprentals_initialize_map);
}else{
wprentals_initialize_map();
}
function wpestate_get_coordinates(container,newpage,NE,SW){
"use strict";
var return_array=[];
var container_id="#"+container;
if(newpage==1||newpage=='1'){
if(page_tracker===0){
return_array['ne_lat']=NE.lat();
return_array['ne_long']=NE.lng();
return_array['sw_lat']=SW.lat();
return_array['sv_long']=SW.lng();
jQuery(container_id).attr('data-ne_lat',return_array['ne_lat']);
jQuery(container_id).attr('data-ne_long',return_array['ne_long']);
jQuery(container_id).attr('data-sw_lat', return_array['sw_lat']);
jQuery(container_id).attr('data-sv_long', return_array['sv_long']);
}else{
return_array['ne_lat']=jQuery(container_id).attr('data-ne_lat');
return_array['ne_long']=jQuery(container_id).attr('data-ne_long');
return_array['sw_lat']=jQuery(container_id).attr('data-sw_lat');
return_array['sv_long']=jQuery(container_id).attr('data-sv_long');
page_tracker=0;
}}else{
return_array['ne_lat']=jQuery(container_id).attr('data-ne_lat');
return_array['ne_long']=jQuery(container_id).attr('data-ne_long');
return_array['sw_lat']=jQuery(container_id).attr('data-sw_lat');
return_array['sv_long']=jQuery(container_id).attr('data-sv_long');
page_tracker=1;
if(return_array['ne_lat']===undefined||return_array['ne_lat']===null){
return_array['ne_lat']=NE.lat();
return_array['ne_long']=NE.lng();
return_array['sw_lat']=SW.lat();
return_array['sv_long']=SW.lng();
}
jQuery(container_id).attr('data_page_tracker',page_tracker);
}
return return_array;
}
function wpestate_reload_pins_onmap(newpage){
"use strict";
if(wprentals_map_type===1){
var curentbounds=map.getBounds();
var NE=curentbounds.getNorthEast();
var SW=curentbounds.getSouthWest();
if(document.getElementById('google_map_prop_list')){
var coordinates_array=wpestate_get_coordinates('google_map_prop_list',newpage,NE,SW);
wpestate_start_filtering_ajax_map(newpage,coordinates_array['ne_lat'], coordinates_array['ne_long'], coordinates_array['sw_lat'],coordinates_array['sv_long'],1);
}else if(document.getElementById('googleMap')){
var coordinates_array=wpestate_get_coordinates('googleMap',newpage,NE,SW);
wpestate_start_filtering_ajax_map(newpage,coordinates_array['ne_lat'], coordinates_array['ne_long'], coordinates_array['sw_lat'],coordinates_array['sv_long'],1);
}}else if(wprentals_map_type===2){
if(document.getElementById('google_map_prop_list')){
var coordinates_array=wpestate_get_coordinates_leaflet('google_map_prop_list',newpage);
wpestate_start_filtering_ajax_map(newpage,coordinates_array['ne_lat'], coordinates_array['ne_long'], coordinates_array['sw_lat'],coordinates_array['sv_long'],1);
}else if(document.getElementById('googleMap')){
var coordinates_array=wpestate_get_coordinates('googleMap',newpage);
wpestate_start_filtering_ajax_map(newpage,coordinates_array['ne_lat'], coordinates_array['ne_long'], coordinates_array['sw_lat'],coordinates_array['sv_long'],1);
}}
}
function wpestate_get_coordinates_leaflet(container,newpage){
"use strict";
var return_array=[];
var container_id="#"+container;
if(newpage==1||newpage=='1'){
var curentbounds=map.getBounds();
if(page_tracker===0){
return_array['ne_lat']=curentbounds.getNorth();
return_array['ne_long']=curentbounds.getEast();
return_array['sw_lat']=curentbounds.getSouth();
return_array['sv_long']=curentbounds.getWest();
jQuery(container_id).attr('data-ne_lat',return_array['ne_lat']);
jQuery(container_id).attr('data-ne_long',return_array['ne_long']);
jQuery(container_id).attr('data-sw_lat', return_array['sw_lat']);
jQuery(container_id).attr('data-sv_long', return_array['sv_long']);
}else{
return_array['ne_lat']=jQuery(container_id).attr('data-ne_lat');
return_array['ne_long']=jQuery(container_id).attr('data-ne_long');
return_array['sw_lat']=jQuery(container_id).attr('data-sw_lat');
return_array['sv_long']=jQuery(container_id).attr('data-sv_long');
page_tracker=0;
}}else{
return_array['ne_lat']=jQuery(container_id).attr('data-ne_lat');
return_array['ne_long']=jQuery(container_id).attr('data-ne_long');
return_array['sw_lat']=jQuery(container_id).attr('data-sw_lat');
return_array['sv_long']=jQuery(container_id).attr('data-sv_long');
page_tracker=1;
if(return_array['ne_lat']===undefined||return_array['ne_lat']===null){
return_array['ne_lat']=curentbounds.getNorth();
return_array['ne_long']=curentbounds.getEast();
return_array['sw_lat']=curentbounds.getSouth();
return_array['sv_long']=curentbounds.getWest();
}
jQuery(container_id).attr('data_page_tracker',page_tracker);
}
return return_array;
};
var has_transparent=0;
var componentForm;
var price_array;
var my_custom_curr_symbol=wprentals_getCookie('my_custom_curr_symbol');
var my_custom_curr_coef=parseFloat(wprentals_getCookie('my_custom_curr_coef'), 10);
var my_custom_curr_pos=parseFloat(wprentals_getCookie('my_custom_curr_pos'), 10);
var my_custom_curr_cur_post=wprentals_getCookie('my_custom_curr_cur_post');
var my_custom_curr_label=wprentals_getCookie('my_custom_curr');
var my_custom_curr_symbol2=decodeURIComponent(wprentals_getCookie('my_custom_curr_symbol2'));
var login_modal_type=1;
var scroll_trigger=0;
const longmonths=Array.from({length:12}, (_, m)=>
new Date(2019, m, 1).toLocaleString(control_vars.datepick_lang, {month:'long'})
);
const dayNamesShort_long=Array.from({length:7}, (_,d)=>
new Date(2019, 6, d).toLocaleString(control_vars.datepick_lang, {weekday:'short'})
);
const dayNamesShort=new Array();
dayNamesShort_long.forEach(wpestate_trim_daynames);
function wpestate_trim_daynames(value){
dayNamesShort.push(value.substring(0, 2));
}
function wprentals_getCookie(cname){
"use strict";
var name, ca, i, c;
name=cname + "=";
ca=document.cookie.split(';');
for (i=0; i < ca.length; i=i + 1){
c=ca[i];
while (c.charAt(0)===' ') c=c.substring(1);
if(c.indexOf(name)===0) return c.substring(name.length,c.length);
}
return "";
}
function wprentals_splash_slider(){
"use strict";
if(jQuery("#splash_slider_wrapper").length>0){
}}
(function($){
"use strict";
$.fn.nodoubletapzoom=function(){
$(this).bind('touchstart', function preventZoom(e){
var t2=e.timeStamp
, t1=$(this).data('lastTouch')||t2
, dt=t2 - t1
, fingers=e.originalEvent.touches.length;
$(this).data('lastTouch', t2);
if(!dt||dt > 500||fingers > 1) return;
e.preventDefault();
$(this).trigger('click').trigger('click');
});
};})(jQuery);
var widgetId1,widgetId2,widgetId3,widgetId4;
var wpestate_onloadCallback=function(){
"use strict";
if(document.getElementById('capthca_register')){
widgetId1=grecaptcha.render('capthca_register', {
'sitekey':control_vars.captchakey,
'theme':'light'
});
grecaptcha.reset();
}
if(document.getElementById('mobile_register_menu')){
widgetId2=grecaptcha.render('mobile_register_menu', {
'sitekey':control_vars.captchakey,
'theme':'light'
});
}
if(document.getElementById('widget_register_menu')){
widgetId3=grecaptcha.render('widget_register_menu', {
'sitekey':control_vars.captchakey,
'theme':'light'
});
}
if(document.getElementById('capthca_register_sh')){
widgetId4=grecaptcha.render('capthca_register_sh', {
'sitekey':control_vars.captchakey,
'theme':'light'
});
}};
jQuery(window).scroll(function ($){
"use strict";
var scroll=jQuery(window).scrollTop();
if(control_vars.stiky_search==='yes'){
wpestate_adv_search_sticky(scroll);
}else{
wpestate_header_sticky(scroll);
}});
function wpestate_header_sticky(scroll){
"use strict";
if(scroll >=10){
if(!Modernizr.mq('only all and (max-width: 1025px)')){
jQuery('.logo').addClass('miclogo');
if(!jQuery(".header_wrapper").hasClass('is_half_map')){
jQuery(".header_wrapper").addClass("navbar-fixed-top");
jQuery(".master_header").addClass("navbar-fixed-top-master");
jQuery(".header_wrapper").addClass("customnav");
if(jQuery(".header_wrapper").hasClass('transparent_header')){
has_transparent=1;
jQuery(".header_wrapper").removeClass('transparent_header');
if(control_vars.transparent_logo!==''){
if(control_vars.normal_logo!==''){
jQuery(".logo img").attr('src',control_vars.normal_logo);
}else{
jQuery(".logo img").attr('src',control_vars.path+"/img/logo.png");
}}
}}
jQuery('.barlogo').show();
jQuery('#user_menu_open').hide();
jQuery('#wpestate_header_shoping_cart').hide();
}
jQuery('.backtop').addClass('islive');
}else{
jQuery(".header_wrapper").removeClass("navbar-fixed-top");
jQuery(".master_header").removeClass("navbar-fixed-top-master");
jQuery(".header_wrapper").removeClass("customnav");
if(has_transparent===1){
jQuery(".header_wrapper").addClass('transparent_header');
if(control_vars.transparent_logo!==''){
jQuery(".logo img").attr('src',control_vars.transparent_logo);
}}
jQuery('.backtop').removeClass('islive');
jQuery('.contactformwrapper').addClass('hidden');
jQuery('.barlogo').hide();
jQuery('#user_menu_open').hide();
jQuery('#wpestate_header_shoping_cart').hide();
jQuery('.logo').removeClass('miclogo');
}}
function wpestate_adv_search_sticky(scroll){
"use strict";
if(scroll>20){
if(jQuery('.has_header_type4').length <=0){
jQuery(".master_header").hide();
}else{
jQuery('.top_bar_wrapper').hide();
}}else{
jQuery(".master_header,.top_bar_wrapper").show();
}
if(wpestate_isScrolledIntoView(scroll)&&scroll_trigger===0){
console.log('wpestate_isScrolledIntoView');
}
if(scroll_trigger!==0){
if(scroll < scroll_trigger){
jQuery('#search_wrapper').removeClass('sticky_adv').removeClass('sticky_adv_anime');
}else if(scroll > scroll_trigger-40&&scroll < scroll_trigger+100){
jQuery('#search_wrapper').addClass('sticky_adv_anime');
}else if(scroll > scroll_trigger){
jQuery('#search_wrapper').removeClass('sticky_adv_anime');
jQuery('#search_wrapper').addClass('sticky_adv');
}}
}
function wpestate_isScrolledIntoView(scroll){
"use strict";
if(jQuery('#search_wrapper').length>0){
var elemTop=parseInt(jQuery('#search_wrapper').offset().top);
var elemHeight=parseInt(jQuery('#search_wrapper').height());
elemHeight=0;
if((elemTop+elemHeight+3)
=110){
jQuery('#advanced_search_map_list_hidden').show();
jQuery('#advanced_search_map_list').removeClass('move_to_fixed');
}else{
jQuery('#advanced_search_map_list_hidden').hide();
}});
jQuery(window).resize(function (){
"use strict";
jQuery('#mobile_menu').hide('10');
});
Number.prototype.format=function (n, x){
"use strict";
var re;
re='\\d(?=(\\d{' + (x||3) + '})+' + (n > 0 ? '\\.':'$') + ')';
return this.toFixed(Math.max(0, ~~n)).replace(new RegExp(re, 'g'), '$&,');
};
function wpestate_show_capture_vertical(){
"use strict";
var position, slideno, slidedif, tomove, curentleft, position;
jQuery('#googleMapSlider').hide();
position=parseFloat(jQuery('#carousel-listing .carousel-inner .active').index(),10);
jQuery('#carousel-indicators-vertical li').removeClass('active');
jQuery('#carousel-listing .caption-wrapper span').removeClass('active');
jQuery("#carousel-listing .caption-wrapper span[data-slide-to='"+position+"'] ").addClass('active');
jQuery("#carousel-listing .caption-wrapper span[data-slide-to='"+position+"'] ").addClass('active');
jQuery("#carousel-indicators-vertical li[data-slide-to='"+position+"'] ").addClass('active');
slideno=position+1;
slidedif=slideno*92;
if(slidedif > 338){
tomove=338-slidedif;
tomove=tomove;
jQuery('#carousel-indicators-vertical').css('top',tomove+"px");
}else{
position=jQuery('#carousel-indicators-vertical').css('top',tomove+"px").position();
curentleft=position.top;
if(curentleft < 0){
tomove=0;
jQuery('#carousel-indicators-vertical').css('top',tomove+"px");
}}
}
function wpestate_owner_insert_book(){
"use strict";
var extra_options,fromdate, todate, listing_edit, nonce, ajaxurl, comment, booking_guest_no,action_function,to_be_paid,price;
ajaxurl=control_vars.admin_url + 'admin-ajax.php';
fromdate=jQuery("#start_date").val();
todate=jQuery("#end_date").val();
listing_edit=jQuery('#listing_edit').val();
comment=jQuery("#book_notes").val();
booking_guest_no=jQuery('#booking_guest_no_wrapper').attr('data-value');
extra_options='';
jQuery('.cost_row_extra input').each(function(){
if((jQuery(this).is(":checked"))){
if(!isNaN(jQuery(this).attr('data-key'))&&typeof(jQuery(this).attr('data-key'))!=undefined){
extra_options=extra_options+jQuery(this).attr('data-key')+",";
}}
});
action_function='wpestate_ajax_add_booking';
if(document.getElementById('submit_booking_front_instant')){
action_function='wpestate_ajax_add_booking_instant';
}
var nonce=jQuery('#wprentals_add_booking').val();
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':action_function,
'fromdate':fromdate,
'todate':todate,
'listing_edit':listing_edit,
'comment':comment,
'booking_guest_no':booking_guest_no,
'extra_options':extra_options,
'security':nonce
},
success: function (data){
jQuery('.has_future').each(function (){
jQuery('#start_date, #end_date').val('');
jQuery('#booking_guest_no_wrapper').html(control_vars.guest_any+' ');
});
if(action_function=='wpestate_ajax_add_booking_instant'){
if(document.getElementById('submit_booking_front_instant')){
if(property_vars.logged_in==="no"){
window.location.href=data;
}else{
jQuery('#instant_booking_modal .modal-body').html(data);
jQuery('#instant_booking_modal').modal({
backdrop: 'static',
keyboard: false});
wpestate_create_payment_action();
}}
}else{
jQuery('#booking_form_request_mess').empty().removeClass('book_not_available').text(control_vars.bookconfirmed);
}
wpestate_redo_listing_sidebar();
},
error: function (errorThrown){
}});
}
function wpestate_redo_listing_sidebar(){
if(jQuery('#primary').hasClass('listing_type_1')){
return;
}
var newmargin=0;
var current_height=jQuery('#booking_form_request').outerHeight();
if(current_height > 525){
newmargin=current_height-525 + 180 ;
jQuery('#primary').css('margin-top',newmargin+'px');
}}
function wprentals_check_booking_valability(){
"use strict";
var book_from, book_to, listing_edit, ajaxurl,internal;
internal=0;
book_from=jQuery('#start_date').val();
book_to=jQuery('#end_date').val();
listing_edit=jQuery('#listing_edit').val();
ajaxurl=control_vars.admin_url + 'admin-ajax.php';
var nonce=jQuery('#wprentals_add_booking').val();
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_ajax_check_booking_valability',
'book_from':book_from,
'book_to':book_to,
'listing_id':listing_edit,
'internal':internal,
'security':nonce
},
success: function (data){
if(data.trim()==='run'){
wpestate_owner_insert_book();
}else if(data==='stopcheckinout'){
jQuery('#booking_form_request_mess').empty().addClass('book_not_available').text(control_vars.stopcheckinout);
}else if(data==='stopcheckin'){
jQuery('#booking_form_request_mess').empty().addClass('book_not_available').text(control_vars.stopcheckin);
}else if(data==='stopdays'){
jQuery('#booking_form_request_mess').empty().addClass('book_not_available').text(control_vars.mindays);
}else{
jQuery('#booking_form_request_mess').empty().addClass('book_not_available').text(control_vars.bookdenied);
}},
error: function (errorThrown){
}});
}
function wpestate_show_instant_book_modal(){
}
function wpestate_owner_insert_book_internal(){
"use strict";
var fromdate, todate, listing_edit, nonce, ajaxurl, comment, booking_guest_no,hour_from,hour_to;
ajaxurl=control_vars.admin_url + 'admin-ajax.php';
fromdate=jQuery("#start_date_owner_book").val();
todate=jQuery("#end_date_owner_book").val();
listing_edit=jQuery('#listing_edit').val();
comment=jQuery("#book_notes").val();
booking_guest_no=jQuery('#booking_guest_no_wrapper').attr('data-value');
var nonce=jQuery('#wprentals_add_booking').val();
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_ajax_add_booking',
'fromdate':fromdate,
'todate':todate,
'listing_edit':listing_edit,
'comment':comment,
'booking_guest_no':booking_guest_no,
'confirmed':1,
'security':nonce
},
success: function (data){
jQuery('.has_future').each(function (){
jQuery(this).removeClass('calendar-reserved-stop');
jQuery(this).removeClass('calendar-reserved-start');
jQuery(this).removeClass('calendar-reserved-stop-visual');
jQuery(this).removeClass('calendar-reserved-start-visual');
jQuery('#owner_reservation_modal').modal('hide');
jQuery('.booking-calendar-wrapper-in .calendar-selected').removeClass('calendar-selected');
jQuery('#book_dates').empty().text(ajaxcalls_vars.reserve);
jQuery('#book_notes').val('');
});
jQuery('#booking_form_request_mess').empty().text(control_vars.bookconfirmed);
},
error: function (errorThrown){
}});
}
function wpestate_check_booking_valability_internal(){
"use strict";
var book_from, book_to, listing_edit, ajaxurl,internal,hour_from,hour_to;
jQuery('#book_dates').empty().text(ajaxcalls_vars.saving);
book_from=jQuery('#start_date_owner_book').val();
book_to=jQuery('#end_date_owner_book').val();
var nonce=jQuery('#wprentals_add_booking').val();
listing_edit=jQuery('#listing_edit').val();
ajaxurl=control_vars.admin_url + 'admin-ajax.php';
internal=1;
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_ajax_check_booking_valability_internal',
'book_from':book_from,
'book_to':book_to,
'listing_id':listing_edit,
'internal':internal,
'security':nonce,
},
success: function (data){
if(data.trim()==='run'){
wpestate_owner_insert_book_internal();
}else{
jQuery('#book_dates').empty().text(ajaxcalls_vars.reserve);
}},
error: function (errorThrown){
}});
}
componentForm={
establishment: 'long_name',
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'long_name',
administrative_area_level_2: 'long_name',
country: 'long_name',
postal_code: 'short_name',
postal_code_prefix: 'short_name',
neighborhood: 'long_name',
natural_feature:'long_name'
};
function wpestate_convert_selected_days_reverse(date){
var from,return_date;
if(control_vars.date_format==='yy-mm-dd'){
return date;
}else if(control_vars.date_format==='yy-dd-mm'){
from=date.split("-");
return_date=from[0]+'-'+from[2]+'-'+from[1];
return return_date;
}else if(control_vars.date_format==='dd-mm-yy'){
from=date.split("-");
return_date=from[2]+'-'+from[1]+'-'+from[0];
return return_date;
}else if(control_vars.date_format==='mm-dd-yy'){
from=date.split("-");
return_date=from[1]+'-'+from[2]+'-'+from[0];
return return_date;
}else if(control_vars.date_format==='dd-yy-mm'){
from=date.split("-");
return_date=from[2]+'-'+from[0]+'-'+from[1];
return return_date;
}else if(control_vars.date_format==='mm-yy-dd'){
from=date.split("-");
return_date=from[1]+'-'+from[0]+'-'+from[2];
return return_date;
}}
function wpestate_convert_selected_days(date){
var from,return_date,date_format;
if(property_vars.book_type==='2'){
date_format=control_vars.date_format.toUpperCase()+" HH:mm";
}else{
date_format=control_vars.date_format.toUpperCase();
}
var new_date_format=date_format.replace("YY", "YYYY");
if(property_vars.book_type==='2'){
var return_date=moment(date,new_date_format).format('YYYY-MM-DD HH:mm');
}else{
var return_date=moment(date,new_date_format).format('YYYY-MM-DD');
}
return return_date;
}
function wpestate_convert_selected_days_simple_add_days(date,days){
var date_format=control_vars.date_format.toUpperCase();
var new_date_format=date_format.replace("YY", "YYYY");
var return_date=moment(date,new_date_format).add(days, 'days');
return_date=moment(return_date).format(new_date_format);
return return_date;
}
function wpestate_convert_selected_days_simple(date){
var from,return_date;
var date_format=control_vars.date_format.toUpperCase();
var new_date_format=date_format.replace("YY", "YYYY");
var return_date=moment(date,new_date_format).format('DD-MM-YYYY');
return return_date;
}
function wpestate_UTC_addDays(date, days){
var result=new Date(date);
var now_utc=new Date(result.getUTCFullYear(), result.getUTCMonth(), result.getUTCDate(), result.getUTCHours(), result.getUTCMinutes(), result.getUTCSeconds());
var new_day=parseFloat(result.getUTCDate())+1 + parseFloat(days);
now_utc.setDate(new_day);
return now_utc;
}
function wpestaste_check_in_out_enable(in_date, out_date){
"use strict";
wpestaste_check_in_out_enable_new(in_date, out_date);
return;
}
function wpestaste_check_in_out_enable_new(in_date, out_date){
var today, prev_date,read_in_date;
today=new Date();
var date_format=control_vars.date_format.toUpperCase();
today=moment(today).format("MM/DD/YYYY");
jQuery("#" + in_date).attr('readonly','readonly');
var day=new Date();
var days=7 - day.getDay() + 6;
var nextDay=new Date(day.setDate(day.getDate() + days));
var saturday=moment(nextDay.toString()).format("MM/DD/YYYY");
var options={
singleDatePicker: true,
autoApply: true,
alwaysShowCalendars: true,
autoUpdateInput: false,
minDate:today,
locale:{
daysOfWeek:dayNamesShort,
monthNames:longmonths,
},
isCustomDate:'isCustomDate_wpstate',
isInvalidDate: function(date){
return (date.day()==1||date.day()==2||date.day()==3||date.day()==4||date.day()==5||date.day()==0);
}};
var options2={
singleDatePicker: true,
autoApply: true,
alwaysShowCalendars: true,
autoUpdateInput: false,
minDate:saturday,
locale:{
daysOfWeek:dayNamesShort,
monthNames:longmonths,
},
isCustomDate:'isCustomDate_wpstate',
isInvalidDate: function(date){
return (date.day()==1||date.day()==2||date.day()==3||date.day()==4||date.day()==5||date.day()==0);
}};
if(in_date==='booking_from_date'){
options.parentEl="#contact_owner_modal";
}
var date_format=control_vars.date_format.toUpperCase();
date_format=date_format.replace("YY", "YYYY");
var in_date_front=jQuery('#' + in_date);
var out_date_front=jQuery('#' + out_date);
jQuery("#" + in_date).daterangepicker(options,
function (start, end, label){
jQuery("#" + out_date).removeAttr('disabled');
start_date=start.format('DD-MM-YYYY');
end_date=end.format('DD-MM-YYYY');
in_date_front.val(start_date);
jQuery('#check_out').val('');
var day2=new Date(Date.parse(start.format('YYYY-MM-DD')));
var days2=7 - day2.getDay() + 6;
var nextDay2=new Date(day2.setDate(day2.getDate() + days2));
var saturday2=moment(nextDay2.toString()).format("DD-MM-YYYY");
jQuery("#check_out").daterangepicker({
singleDatePicker: true,
autoApply: true,
alwaysShowCalendars: true,
autoUpdateInput: true,
minDate: saturday2,
"locale": {
format: 'DD-MM-YYYY'
},
isInvalidDate: function(date){
return (date.day()==1||date.day()==2||date.day()==3||date.day()==4||date.day()==5||date.day()==0);
}});
if(jQuery("#google_map_prop_list_sidebar").length>0){
wpestate_start_filtering_ajax_map(1);
}}
);
jQuery("#" + out_date).daterangepicker(options2,
function (start, end, label){
jQuery("#" + out_date).removeAttr('disabled');
start_date=start.format('DD-MM-YYYY');
end_date=end.format('DD-MM-YYYY');
out_date_front.val(end_date);
if(jQuery("#google_map_prop_list_sidebar").length>0){
wpestate_start_filtering_ajax_map(1);
}}
);
}
function isCustomDate_wpstate(date){
return 'maca';
}
function wpestate_booking_calendat_get_price(unixtime1_key,display_price){
var return_price;
return_price='';
if(!isNaN(my_custom_curr_pos)&&my_custom_curr_pos!==-1){
if(my_custom_curr_cur_post==='before'){
if(price_array[unixtime1_key]===undefined){
if(display_price===''){
display_price=control_vars.default_price;
}
if(parseFloat(price_per_guest_from_one,10)===1){
display_price=parseFloat (extra_price_per_guest,10);
}
display_price=wpestate_replace_plus(decodeURIComponent(my_custom_curr_label)) + String(Math.round(display_price* my_custom_curr_coef));
}else{
if(display_price===''){
display_price=price_array[unixtime1_key] ;
}
if(parseFloat(price_per_guest_from_one,10)===1){
display_price=mega_details[unixtime1_key]['period_extra_price_per_guest'];
}
display_price=wpestate_replace_plus(decodeURIComponent(my_custom_curr_label)) + String(Math.round(display_price * my_custom_curr_coef));
}}else{
if(price_array[unixtime1_key]===undefined){
if(display_price===''){
display_price=control_vars.default_price;
}
if(parseFloat(price_per_guest_from_one,10)===1){
display_price=parseFloat (extra_price_per_guest,10);
}
display_price=String(Math.round(display_price * my_custom_curr_coef)) + wpestate_replace_plus(decodeURIComponent(my_custom_curr_label)) ;
}else{
if(display_price===''){
display_price=price_array[unixtime1_key] ;
}
if(parseFloat(price_per_guest_from_one,10)===1){
display_price=mega_details[unixtime1_key]['period_extra_price_per_guest'];
}
display_price=String(Math.round(display_price * my_custom_curr_coef))+ wpestate_replace_plus(decodeURIComponent(my_custom_curr_label));
}}
}else{
if(control_vars.where_curency==='before'){
if(price_array[unixtime1_key]===undefined){
if(display_price===''){
display_price=control_vars.default_price;
}
display_price=wpestate_replace_plus(decodeURIComponent(control_vars.curency)) + display_price;
}else{
if(display_price===''){
display_price=price_array[unixtime1_key] ;
}
display_price=wpestate_replace_plus(decodeURIComponent(control_vars.curency)) + String(display_price);
}}else{
if(price_array[unixtime1_key]===undefined){
if(display_price===''){
display_price=control_vars.default_price;
}
display_price=display_price + wpestate_replace_plus(decodeURIComponent(control_vars.curency));
}else{
if(display_price===''){
display_price=price_array[unixtime1_key] ;
}
display_price=String(display_price)+ wpestate_replace_plus(decodeURIComponent(control_vars.curency));
}}
}
if(parseFloat(price_per_guest_from_one,10)===1){
if(!isNaN(my_custom_curr_pos)&&my_custom_curr_pos!==-1){
var to_show=parseFloat (extra_price_per_guest,10)*my_custom_curr_coef;
if(my_custom_curr_cur_post==='before'){
display_price=control_vars.from+" "+wpestate_replace_plus(decodeURIComponent(my_custom_curr_label))+ ' '+ to_show.toFixed(0) ;
}else{
display_price=control_vars.from+" "+ to_show.toFixed(0) + wpestate_replace_plus(decodeURIComponent(my_custom_curr_label)) ;
}}else{
if(control_vars.where_curency==='before'){
display_price=control_vars.from+" "+wpestate_replace_plus(decodeURIComponent(control_vars.curency))+parseFloat (extra_price_per_guest,10) ;
}else{
display_price=control_vars.from+" "+parseFloat (extra_price_per_guest,10) + wpestate_replace_plus(decodeURIComponent(control_vars.curency)) ;
}}
}
return display_price;
}
function wpestate_enable_slider_radius(slider_name,low_val, max_val, now_val){
if(jQuery("#" + slider_name).length > 0){
jQuery("#" + slider_name).slider({
range: true,
min: parseFloat(low_val),
max: parseFloat(max_val),
value: parseFloat(now_val),
range: "max",
slide: function (event, ui){
jQuery("#geolocation_radius").val(ui.value);
jQuery('.radius_value').text(ui.value+" "+control_vars.geo_radius_measure);
},
stop: function (event, ui){
if(placeCircle!=''){
if(control_vars.geo_radius_measure==='miles'){
placeCircle.setRadius(ui.value*1609.34);
}else{
placeCircle.setRadius(ui.value*1000);
}
map.fitBounds(placeCircle.getBounds());
wpestate_start_filtering_ajax_map(1);
}}
});
}
jQuery("#geolocation_search").on('change', function(){
if(jQuery(this).val()===''){
jQuery('#geolocation_lat').val('');
jQuery('#geolocation_long').val('');
if(placeCircle!=''){
placeCircle.setMap(null);
placeCircle='';
}}
});
if(jQuery("#geolocation_search").length > 0){
if(typeof google==='object'&&typeof google.maps==='object'&&parseInt(mapbase_vars.wprentals_places_type)==1){
var input, defaultBounds, autocomplete_normal;
input=(document.getElementById('geolocation_search'));
defaultBounds=new google.maps.LatLngBounds(new google.maps.LatLng(-90, -180),
new google.maps.LatLng(90, 180)
);
var options={
bounds: defaultBounds,
types: ['geocode'],
};
autocomplete_normal=new google.maps.places.Autocomplete(input, options);
google.maps.event.addListener(autocomplete_normal, 'place_changed', function (){
initial_geolocation_circle_flag=0;
var place=autocomplete_normal.getPlace();
var place_lat=place.geometry.location.lat();
var place_lng=place.geometry.location.lng();
jQuery('#geolocation_lat').val(place_lat);
jQuery('#geolocation_long').val(place_lng);
wpestate_start_filtering_ajax_map(1);
});
}}
}
function wpestate_enable_slider(slider_name, price_low, price_max, amount, my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post, my_custom_curr_coef,my_custom_curr_label){
"use strict";
var price_low_val, price_max_val, temp_min, temp_max;
price_low_val=parseFloat(jQuery('#'+price_low).val(), 10);
price_max_val=parseFloat(jQuery('#'+price_max).val(), 10);
var slider_min=control_vars.slider_min;
var slider_max=control_vars.slider_max;
if(!isNaN(my_custom_curr_pos)&&my_custom_curr_pos!==-1){
slider_min=parseFloat(slider_min *my_custom_curr_coef,10);
slider_max=parseFloat(slider_max *my_custom_curr_coef,10);
}
jQuery("#" + slider_name).slider({
range: true,
min: parseFloat(slider_min),
max: parseFloat(slider_max),
values: [price_low_val, price_max_val ],
slide: function (event, ui){
jQuery("#" + price_low).val(ui.values[0]);
jQuery("#" + price_max).val(ui.values[1]);
if(!isNaN(my_custom_curr_pos)&&my_custom_curr_pos!==-1){
temp_min=ui.values[0];
temp_max=ui.values[1];
if(my_custom_curr_cur_post==='before'){
jQuery("#" + amount).text(wpestate_replace_plus(decodeURIComponent(my_custom_curr_label)) + " " + temp_min.format() + " " + control_vars.to + " " + wpestate_replace_plus(decodeURIComponent(my_custom_curr_label))+ " " + temp_max.format());
}else{
jQuery("#" + amount).text(temp_min.format() + " " + wpestate_replace_plus(decodeURIComponent(my_custom_curr_label))+ " " + control_vars.to + " " + temp_max.format() + " " + wpestate_replace_plus(decodeURIComponent(my_custom_curr_label)));
}}else{
if(control_vars.where_curency==='before'){
jQuery("#" + amount).text(wpestate_replace_plus(decodeURIComponent(control_vars.curency)) + " " + ui.values[0].format() + " " + control_vars.to + " " + wpestate_replace_plus(decodeURIComponent(control_vars.curency)) + " " + ui.values[1].format());
}else{
jQuery("#" + amount).text(ui.values[0].format() + " " + wpestate_replace_plus(decodeURIComponent(control_vars.curency)) + " " + control_vars.to + " " + ui.values[1].format() + " " + wpestate_replace_plus(decodeURIComponent(control_vars.curency)));
}}
}});
}
function wpestate_replace_plus(string){
return string.replace("+"," ");
}
function wpestate_prevent_enter_submit(main_search,search_location, check_in, check_out, guest_no){
jQuery('#'+main_search).on("keyup keypress", function(e){
var code=e.keyCode||e.which;
if(code==13){
e.preventDefault();
if(jQuery('#'+search_location).val()!==''){
if(jQuery('#'+check_in).val()!==''){
if(jQuery('#'+check_out).val()!==''){
jQuery('#'+check_out).focusout();
jQuery('#'+check_out).datepicker("hide");
jQuery('#'+guest_no).focus().dropdown('toggle');
jQuery('#'+check_out).datepicker("hide");
}else{
jQuery('#'+check_in).datepicker("hide");
jQuery('#'+check_out).datepicker("show");
}}else{
jQuery('#'+check_in).datepicker("show");
}}
return false;
}});
}
function wpestate_lazy_load_carousel_property_unit(){
jQuery('.property_unit_carousel img').each(function(event){
var new_source='';
new_source=jQuery(this).attr('data-lazy-load-src');
if(typeof (new_source)!=='undefined'&&new_source!==''){
jQuery(this).attr('src',new_source);
}});
}
jQuery(document).ready(function ($){
"use strict";
var bLazy, search_label, curent, price_regular, price_featured, total, percent, parent, price_low_val, price_max_val, autoscroll_slider, all_browsers_stuff, wrap_h, map_h, mediaQuery;
$.datepicker.setDefaults($.datepicker.regional[control_vars.datepick_lang]);
$.datepicker.setDefaults({
dateFormat: control_vars.date_format,
});
if(control_vars.wp_estate_slider_cycle!=''&&control_vars.wp_estate_slider_cycle!='0'){
$('#estate-carousel_slick').slick({
'arrows':true,
'dots':true,
'cssEase': 'cubic-bezier(0.645, 0.045, 0.355, 1.000)',
'autoplay': true,
'autoplaySpeed': control_vars.wp_estate_slider_cycle
});
}else{
$('#estate-carousel_slick').slick({
'arrows':true,
'dots':true,
'cssEase': 'cubic-bezier(0.645, 0.045, 0.355, 1.000)',
});
}
$('#listing_main_image_photo_slider').slick({
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
dots: true,
'arrows':true,
responsive: [
{
breakpoint:1025,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}}
]
});
if(control_vars.is_rtl==='1'){
$('#listing_main_image_photo_slider').slick('slickSetOption','rtl',true,true);
}
if(Modernizr.mq('only all and (min-width: 1024px)')){
$('#estate-carousel_slick').on('beforeChange', function(event, slick, currentSlide, nextSlide){
$('.item-version').hide(200);
$('.price-slider-wrapper').hide(300);
$('.theme-slider-view').hide(400);
});
$('#estate-carousel_slick').on('afterChange', function(event, slick, currentSlide, nextSlide){
$('.item-version').slideDown('200',function(){
$('.price-slider-wrapper').slideDown(300);
$('.theme-slider-view').slideDown(600);
});
});
}
if($(".full_screen_yes").length){
var new_height;
if(jQuery('.transparent_header').length > 0){
new_height=jQuery(window).height();
}else{
new_height=jQuery(window).height() - jQuery('.master_header').height();
}
if($('.with_search_on_start').length>0){
new_height=new_height- jQuery('.search_wrapper.with_search_on_start ').height();
}
jQuery('.wpestate_header_image,.wpestate_header_video,.theme_slider_wrapper,.theme_slider_classic,.theme_slider_wrapper .item_type2 ').css('height',new_height);
}
$('.search_location_autointernal_list li').on('click',function(event){
var meta_tax=$(this).attr('data-tax');
var parent=$(this).parent().parent().parent();
parent.find('.stype').val(meta_tax);
});
var handler_top;
$('.adv_handler').on('click', function(event){
event.preventDefault();
var check_row=$('.adv_search_hidden_fields');
if($('#search_wrapper').hasClass('with_search_form_float')){
if(!$('#search_wrapper').hasClass('openmore')){
check_row.css('display','block');
var height=check_row.height();
handler_top=parseInt($('#search_wrapper').css('top'));
var top=parseInt($('#search_wrapper').css('top'))-height;
check_row.css('display','none');
$('.adv_search_hidden_fields').slideDown({ duration: 200, queue: false });
$('#search_wrapper').addClass('openmore');
}else{
$('.adv_search_hidden_fields').slideUp ({ duration: 200, queue: false });
$('#search_wrapper').removeClass('openmore');
}}else{
$('.adv_search_hidden_fields').slideToggle();
}});
$('.estate_places_slider').each(function(){
var items=$(this).attr('data-items-per-row');
var auto=parseInt($(this).attr('data-auto'));
var slick=$(this).slick({
infinite: true,
slidesToShow: items,
slidesToScroll: 1,
dots: false,
responsive: [
{
breakpoint:1025,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}}
]
});
if(control_vars.is_rtl==='1'){
$(this).slick('slickSetOption','rtl',true,true);
$(this).slick('slidesToScroll','-1');
}});
wpestate_enable_stripe_booking_prop();
jQuery('#direct_pay').on('click',function(){
var direct_pay_modal, selected_pack,selected_prop,include_feat,attr, price_pack;
selected_pack=$('#pack_select').val();
var price_pack=$('#pack_select option:selected').attr('data-price');
if(control_vars.where_curency==='after'){
price_pack=price_pack +' '+control_vars.submission_curency;
}else{
price_pack=control_vars.submission_curency+' '+price_pack;
}
price_pack=control_vars.direct_price+': '+price_pack;
if(selected_pack!==''){
window.scrollTo(0, 0);
direct_pay_modal=''+price_pack+' '+control_vars.direct_pay+' '+control_vars.send_invoice+'
';
jQuery('body').append(direct_pay_modal);
jQuery('#direct_pay_modal').modal();
wpestate_enable_direct_pay();
}
$('#direct_pay_modal').on('hidden.bs.modal', function (e){
$('#direct_pay_modal').remove();
});
});
$('.perpack').on('click',function(){
var direct_pay_modal, selected_pack,selected_prop,include_feat,attr;
selected_prop=$(this).attr('data-listing');
var price_pack=$(this).parent().parent().find('.submit-price-total').text();
attr=$(this).attr('data-isupgrade');
if(typeof attr!==typeof undefined&&attr!==false){
price_pack=$(this).parent().parent().find('.submit-price-featured').text();
}
if(control_vars.where_curency==='after'){
price_pack=price_pack +' '+control_vars.submission_curency;
}else{
price_pack=control_vars.submission_curency+' '+price_pack;
}
price_pack=control_vars.direct_price+': '+price_pack;
include_feat=' data-include-feat="0" ';
$('#send_direct_bill').attr('data-include-feat',0);
$('#send_direct_bill').attr('data-listing',selected_prop);
if($(this).parent().find('.extra_featured').attr('checked')){
include_feat=' data-include-feat="1" ';
$('#send_direct_bill').attr('data-include-feat',1);
}
if(typeof attr!==typeof undefined&&attr!==false){
include_feat=' data-include-feat="1" ';
$('#send_direct_bill').attr('data-include-feat',1);
}
window.scrollTo(0, 0);
direct_pay_modal='
'+price_pack+' '+control_vars.direct_pay+' '+control_vars.send_invoice+'
';
jQuery('body').append(direct_pay_modal);
jQuery('#direct_pay_modal').modal();
wpestate_enable_direct_pay_perlisting();
$('#direct_pay_modal').on('hidden.bs.modal', function (e){
$('#direct_pay_modal').remove();
});
});
function wpestate_enable_direct_pay(){
jQuery('#send_direct_bill').on('click',function(){
jQuery('#send_direct_bill').unbind('click');
var selected_pack,ajaxurl;
selected_pack=jQuery(this).attr('data-pack');
ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php';
var nonce=jQuery('#wprentals_payments_actions').val();
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_direct_pay_pack',
'selected_pack':selected_pack,
'security':nonce,
},
success: function (data){
jQuery('#send_direct_bill').hide();
jQuery('#direct_pay_modal .listing-submit span:nth-child(2)').empty().html(control_vars.direct_thx);
},
error: function (errorThrown){}});
});
}
function wpestate_enable_direct_pay_perlisting(){
jQuery('#send_direct_bill').unbind('click');
jQuery('#send_direct_bill').on('click',function(){
jQuery('#send_direct_bill').unbind('click');
var selected_pack,ajaxurl,include_feat;
selected_pack=jQuery(this).attr('data-listing');
include_feat=jQuery(this).attr('data-include-feat');
ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php';
var nonce=jQuery('#wprentals_payments_actions').val();
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_direct_pay_pack_per_listing',
'selected_pack':selected_pack,
'include_feat':include_feat,
'security':nonce
},
success: function (data){
jQuery('#send_direct_bill').hide();
jQuery('#direct_pay_modal .listing-submit span:nth-child(2)').empty().html(control_vars.direct_thx);
},
error: function (errorThrown){}});
});
}
if(document.getElementById('imagelist')){
$("#imagelist").sortable({
revert: true,
update: function(event, ui){
var all_id,new_id;
all_id="";
$("#imagelist .uploaded_images").each(function(){
new_id=$(this).attr('data-imageid');
if(typeof new_id!='undefined'){
all_id=all_id+","+new_id;
}});
$('#attachid').val(all_id);
},
});
}
$(window).bind("load", function(){
wpestate_lazy_load_carousel_property_unit();
});
$('.retina_ready').dense();
$('#user_tab_menu_trigger').on('click',function(){
$('#user_tab_menu_container').toggle('200');
});
$('#carousel-listing').on('slid.bs.carousel', function (){
wpestate_show_capture_vertical();
$('#carousel-listing div').removeClass('slideron');
$('#slider_enable_slider').addClass('slideron');
});
wpestate_prevent_enter_submit('main_search','search_location','check_in','check_out','guest_no');
wpestate_prevent_enter_submit('widget_search','search_locationsidebar','checkinwidget','checkoutwidget','guest_no_wid');
wpestate_prevent_enter_submit('form-search-mobile','search_location_mobile','check_in_mobile','check_out_mobile','guest_no_mobile');
jQuery('.blog_unit_back ').on('click',function(){
window.open($(this).find('.blog-title-link').attr('href'), '_self', false);
});
jQuery(".calendar_pad").on("hover", function(event){
if(event.type==="mouseenter"){
var timeunix=$(this).attr('data-curent-date');
$(".calendar_pad[data-curent-date=" + timeunix + "]").addClass('calendar-pad-hover');
$(".calendar_pad_title[data-curent-date=" + timeunix + "]").addClass('calendar-pad-hover');
if($(this).hasClass('calendar-reserved')){
var reservation_data=$(this).find('.allinone_reservation');
reservation_data.show();
var internal_booking_id=parseFloat($(this).find('.allinone_reservation').attr('data-internal-reservation'),10);
if(!isNaN(internal_booking_id)&&internal_booking_id!=0){
var ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php';
var nonce=jQuery('#wprentals_allinone').val();
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_get_booking_data',
'internal_booking_id':internal_booking_id,
'security':nonce
},
success: function (data){
reservation_data.empty().append(data);
},
error: function (errorThrown){}});
}}
}else if(event.type==="mouseleave"){
$(this).find('.allinone_reservation').hide();
var timeunix=$(this).attr('data-curent-date');
$(".calendar_pad[data-curent-date=" + timeunix + "]").removeClass('calendar-pad-hover');
$(".calendar_pad_title[data-curent-date=" + timeunix + "]").removeClass('calendar-pad-hover');
}});
$('.all-elements').animate({
minHeight: 100 + '%'
});
$('.header-tip').addClass('hide-header-tip');
$('.mobile-trigger').on('click',function (){
if($('#all_wrapper').hasClass('moved_mobile')){
$('.mobilewrapper-user').show();
$('#all_wrapper').removeAttr('style');
$('#all_wrapper').removeClass('moved_mobile');
$('.mobilewrapper').removeAttr('style');
}else{
$('.mobilewrapper-user').hide();
$('.mobilewrapper').show();
$('#all_wrapper').css('-webkit-transform', 'translate(265px, 0px)');
$('#all_wrapper').css('-moz-transform', 'translate(265px, 0px)');
$('#all_wrapper').css('-ms-transform', 'translate(265px, 0px)');
$('#all_wrapper').css('-o-transform', 'translate(265px, 0px)');
$('#all_wrapper').addClass('moved_mobile');
$('.mobilewrapper').css('-webkit-transform', 'translate(0px, 0px)');
$('.mobilewrapper').css('-moz-transform', 'translate(0px, 0px)');
$('.mobilewrapper').css('-ms-transform', 'translate(0px, 0px)');
$('.mobilewrapper').css(' -o-transform', 'translate(0px, 0px)');
}});
$('.mobile-trigger-user').on('click',function (){
if($('#all_wrapper').hasClass('moved_mobile_user')){
$('#all_wrapper').removeClass('moved_mobile_user');
$('#all_wrapper').removeAttr('style');
$('.mobilewrapper-user').hide();
$('.mobilewrapper').show();
$('.mobilewrapper-user').removeAttr('style');
}else{
$('#all_wrapper').css('-webkit-transform', 'translate(-265px, 0px)');
$('#all_wrapper').css('-moz-transform', 'translate(-265px, 0px)');
$('#all_wrapper').css('-ms-transform', 'translate(-265px, 0px)');
$('#all_wrapper').css('-o-transform', 'translate(-265px, 0px)');
$('#all_wrapper').addClass('moved_mobile_user');
$('.mobilewrapper-user').show();
$('.mobilewrapper').hide();
$('.mobilewrapper-user').css('-webkit-transform', 'translate(0px, 0px)');
$('.mobilewrapper-user').css('-moz-transform', 'translate(0px, 0px)');
$('.mobilewrapper-user').css('-ms-transform', 'translate(0px, 0px)');
$('.mobilewrapper-user').css(' -o-transform', 'translate(0px, 0px)');
}});
$('.user_tab_menu_close').on('click',function (){
$('#all_wrapper').removeAttr('style');
$('#all_wrapper').removeClass('moved_mobile_user');
$('#user_tab_menu_container').removeAttr('style');
});
$('.mobilemenu-close-user').on('click',function (){
$('#all_wrapper').removeAttr('style');
$('#all_wrapper').removeClass('moved_mobile_user');
$('.mobilewrapper-user').removeAttr('style');
});
$('.mobilemenu-close').on('click',function (){
$('.mobilewrapper-user').show();
$('#all_wrapper').removeAttr('style');
$('#all_wrapper').removeClass('moved_mobile');
$('.mobilewrapper').removeAttr('style');
});
$('.mobilex-menu li').on('click',function (event){
event.stopPropagation();
var selected;
selected=$(this).find('.sub-menu:first');
selected.slideToggle();
});
$('#user_menu_u').on('click',function (event){
jQuery('#wpestate_header_shoping_cart').fadeOut(400);
if($('#user_menu_open').is(":visible")){
$('#user_menu_open').removeClass('iosfixed').fadeOut(400);
}else{
$('#user_menu_open').fadeIn(400);
}
event.stopPropagation();
});
$('#shopping-cart').on('click',function (event){
$('#user_menu_open').removeClass('iosfixed').fadeOut(400);
if($('#wpestate_header_shoping_cart').is(":visible")){
jQuery('#wpestate_header_shoping_cart').fadeOut(400);
}else{
jQuery('#wpestate_header_shoping_cart').fadeIn(400);
}
event.stopPropagation();
});
$(document).on('click',function (event){
var clicka;
clicka=event.target.id;
jQuery('#wpestate_header_shoping_cart').fadeOut(400);
if(!$('#' + clicka).parents('.topmenux').length){
$('#user_menu_open').removeClass('iosfixed').hide(400);
}});
$('.list_sidebar_currency li').on('click',function (){
var ajaxurl, data, pos, symbol, coef, curpos,symbol2;
data=$(this).attr('data-value');
pos=$(this).attr('data-pos');
symbol=$(this).attr('data-symbol');
coef=$(this).attr('data-coef');
curpos=$(this).attr('data-curpos');
symbol2=$(this).attr('data-symbol2');
var nonce=jQuery('#wprentals_change_currency').val();
ajaxurl=ajaxcalls_vars.admin_url + 'admin-ajax.php';
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action':'wpestate_set_cookie_multiple_curr',
'curr':data,
'pos':pos,
'symbol':symbol,
'symbol2':symbol2,
'coef':coef,
'curpos':curpos,
'security':nonce,
},
success: function (data){
location.reload();
},
error: function (errorThrown){}});
});
$('#adv_extended_options_text_adv').on('click',function (){
$('#extended_search_check_filter,.extended_search_check_wrapper').slideDown();
$('#adv_extended_close_adv').show();
$(this).hide();
});
$('#adv_extended_close_adv').on('click',function (){
$(this).hide();
$('#extended_search_check_filter,.extended_search_check_wrapper').slideUp();
$('#adv_extended_options_text_adv').show();
});
$('#adv_extended_options_show_filters').on('click',function (){
$('#advanced_search_map_list').addClass('move_to_fixed');
$('#extended_search_check_filter').slideDown();
$('#adv_extended_close_adv').show();
$('#adv_extended_options_text_adv').hide();
});
wpestaste_check_in_out_enable('check_in', 'check_out');
wpestaste_check_in_out_enable('check_in_list', 'check_out_list');
wpestaste_check_in_out_enable('booking_from_date', 'booking_to_date');
wpestaste_check_in_out_enable('check_in_mobile', 'check_out_mobile');
wpestaste_check_in_out_enable('check_in_widget', 'check_out_widget');
wpestaste_check_in_out_enable('check_in_shortcode', 'check_out_shortcode');
$('#ui-datepicker-div').css('clip', 'auto');
$('#pack_select').change(function (){
if($(this).val()!==''){
$('.pay_disabled').removeClass('pay_disabled');
}else{
$('.payments_buttons_wrapper').addClass('pay_disabled');
}
var stripe_pack_id, stripe_ammount, the_pick,labelstripe;
$("#pack_select option:selected").each(function (){
stripe_pack_id=$(this).val();
stripe_ammount=parseFloat($(this).attr('data-price')) ;
the_pick=$(this).attr('data-pick');
labelstripe=$(this).text();
});
$('#pack_id').val(stripe_pack_id);
$('#pay_ammout').val(stripe_ammount);
$('.wpestate_stripe_pay_desc').html(control_vars.stripe_pay_for+" "+labelstripe);
$('#wpestate_stripe_form_button_sumit').html(control_vars.stripe_pay+" "+stripe_ammount+" "+control_vars.submission_curency);
});
$('#pack_recuring').on('click',function (){
if($(this).attr('checked')){
$('#stripe_form').append('
');
}else{
$('#stripe_recuring').remove();
}});
$('.check_avalability, .property_menu_wrapper_hidden a').on('click',function (){
var target;
if(location.pathname.replace(/^\//, '')===this.pathname.replace(/^\//, '')&&location.hostname===this.hostname){
target=$(this.hash);
if(target.selector==='#carousel-control-theme-next'||target.selector==='#carousel-control-theme-prev'||target.selector==='#carousel-listing'||target.selector==='#carousel-example-generic'||target.selector==='#post_carusel_right'){
return;
}
target=target.length ? target:$('[name=' + this.hash.slice(1) + ']');
if(target.length){
$('html,body').animate({
scrollTop: target.offset().top - 140
}, 1000);
return false;
}}
});
jQuery("#google_map_prop_list_sidebar .listing_wrapper").on("hover", function(event){
if(event.type==="mouseenter"){
event.stopPropagation();
var listing_id=$(this).attr('data-listid');
if(typeof wpestate_hover_action_pin=='function'){
wpestate_hover_action_pin(listing_id);
}}else if(event.type==="mouseleave"){
event.stopPropagation();
var listing_id=$(this).attr('data-listid');
if(typeof wpestate_return_hover_action_pin=='function'){
wpestate_return_hover_action_pin(listing_id);
}}
});
componentForm={
establishment: 'long_name',
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'long_name',
administrative_area_level_2: 'long_name',
administrative_area_level_3: 'long_name',
administrative_area_level_4: 'long_name',
country: 'long_name',
postal_code: 'short_name',
postal_code_prefix:'short_name',
neighborhood: 'long_name',
sublocality_level_1: 'long_name',
natural_feature:'long_name'
};
wpestate_autocomplete_google('search_location');
wpestate_autocomplete_google('search_locationshortcode');
wpestate_autocomplete_google('search_locationmobile');
wpestate_autocomplete_google('search_locationsidebar');
function wpestate_autocomplete_google(input_id){
if(typeof google==='object'&&typeof google.maps==='object'&&parseInt(mapbase_vars.wprentals_places_type)==1){
var input, defaultBounds, autocomplete_normal,extension;
input=(document.getElementById(input_id));
if(input instanceof HTMLInputElement){
extension='';
if(input_id=='search_locationshortcode'){
extension='shortcode';
}else if(input_id=='search_locationmobile'){
extension='mobile';
}else if(input_id=='search_locationsidebar'){
extension='sidebar';
}
defaultBounds=new google.maps.LatLngBounds(new google.maps.LatLng(-90, -180),
new google.maps.LatLng(90, 180)
);
var options={
bounds: defaultBounds,
types: ['geocode'],
};
autocomplete_normal=new google.maps.places.Autocomplete(input, options);
google.maps.event.addListener(autocomplete_normal, 'place_changed', function (){
var place=autocomplete_normal.getPlace();
wprentals_fillInAddress_filter_google(place,extension);
});
}}
}
function wprentals_fillInAddress_filter_google(place,extension){
var i, addressType, val, is_google_map,have_city,admin_area;
have_city=0;
admin_area='';
$('#advanced_area'+extension).val('');
$('#advanced_city'+extension).val('');
$('#advanced_country'+extension).val('');
$('#search_location_area'+extension).val('');
$('#search_location_city'+extension).val('');
$('#search_location_country'+extension).val('');
$('#property_admin_area'+extension).val('');
for (i=0; i < place.address_components.length; i++){
addressType=place.address_components[i].types[0];
val=place.address_components[i][componentForm[addressType]];
if(typeof (val)!=='undefined'){
val=val.toLowerCase();
val=val.split(' ').join('-');
}
if(addressType==='neighborhood'||addressType==='sublocality_level_1'){
$('#advanced_area'+extension).attr('data-value', val);
$('#advanced_area'+extension).val(val);
$('#search_location_area'+extension).val(val);
}else if(addressType==='administrative_area_level_4'){
admin_area=wpestate_build_admin_area(admin_area,val);
}else if(addressType==='administrative_area_level_3'){
admin_area=wpestate_build_admin_area(admin_area,val);
}else if(addressType==='administrative_area_level_2'){
admin_area=wpestate_build_admin_area(admin_area,val);
}else if(addressType==='administrative_area_level_1'){
admin_area=wpestate_build_admin_area(admin_area,val);
}else if(addressType==='locality'){
$('#advanced_city'+extension).attr('data-value', val);
$('#advanced_city'+extension).val(val);
$('#search_location_city'+extension).val(val);
if(val!==''){
have_city=1;
}}else if(addressType==='country'||addressType==='natural_feature'){
$('#advanced_country'+extension).attr('data-value', val);
$('#advanced_country'+extension).val(val);
$('#search_location_country'+extension).val(val);
}}
if(have_city===0){
wpestate_second_measure_city('advanced_city'+extension,place.adr_address);
wpestate_second_measure_city('search_location_city'+extension,place.adr_address);
}
if(jQuery('#advanced_search_map_list').length>0){
wpestate_start_filtering_ajax_map(1);
}
is_google_map=parseFloat(jQuery('#isgooglemap').attr('data-isgooglemap'), 10);
if(is_google_map===1){
var guest_val=$(this).attr('data-value');
}}
function wpestate_build_admin_area(admin_area,val){
if(admin_area===''){
admin_area=admin_area+val;
}else{
admin_area=admin_area+", "+val;
}
$('#property_admin_area,#property_admin_areasidebar,#property_admin_areashortcode,#property_admin_areamobile').val(admin_area);
return admin_area;
}
function wpestate_second_measure_city(stringplace,adr_address){
var new_city;
new_city=$(adr_address).filter('span.locality').html() ;
$('#'+stringplace).val(new_city);
}
function wpestate_fillInAddress(){
var place, adr, country;
place=autocomplete.getPlace();
adr=place['address_components'];
country=adr[adr.length - 1]['long_name'];
document.getElementById('property_city').value=place['name'];
document.getElementById('property_country').value=country;
}
$('#check_out').change(function(){
if($('#check_in').val()!==''){
var guest_val=$(this).attr('data-value');
}});
$('#guest_no_main_list li').on('click',function(){
var guest_val=$(this).attr('data-value');
});
$('#topbarlogin').on('click',function (event){
wpestate_show_login_form(1, 0, 0);
});
$('#topbarregister').on('click',function (event){
wpestate_show_login_form(2, 0, 0);
});
price_low_val=parseFloat($('#price_low').val(), 10);
price_max_val=parseFloat($('#price_max').val(), 10);
if(jQuery('#slider_price').length>0){
wpestate_enable_slider('slider_price', 'price_low', 'price_max', 'amount', my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post,my_custom_curr_coef,my_custom_curr_label);
}
if(jQuery('#slider_price_widget').length>0){
wpestate_enable_slider('slider_price_widget', 'price_low_widget', 'price_max_widget', 'amount_wd', my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post,my_custom_curr_coef,my_custom_curr_label);
}
if(jQuery('#slider_price_sh').length>0){
wpestate_enable_slider('slider_price_sh', 'price_low_sh', 'price_max_sh', 'amount_sh', my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post,my_custom_curr_coef,my_custom_curr_label);
}
if(jQuery('#slider_price_mobile').length>0){
wpestate_enable_slider('slider_price_mobile', 'price_low_mobile', 'price_max_mobile', 'amount_mobile', my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post,my_custom_curr_coef,my_custom_curr_label);
}
if(jQuery('#wpestate_slider_radius').length>0){
wpestate_enable_slider_radius('wpestate_slider_radius',control_vars.min_geo_radius, control_vars.max_geo_radius, control_vars.initial_radius);
}
function wpestate_slider_control_left_function(element){
var step_size, margin_left, new_value, last_element, base_value, parent;
parent=element.parent();
step_size=parent.find('.shortcode_slider_list').width();
margin_left=parseFloat(parent.find('.shortcode_slider_list').css('margin-left'), 10);
new_value=margin_left - 389;
base_value=3;
parent.find('.shortcode_slider_list').css('margin-left', new_value + 'px');
last_element=parent.find('.shortcode_slider_list li:last-child');
parent.find('.shortcode_slider_list li:last-child').remove();
parent.find('.shortcode_slider_list').prepend(last_element);
wpestate_restart_js_after_ajax();
parent.find('.shortcode_slider_list').animate({
'margin-left': base_value
}, 800, function (){
});
}
function wpestate_slider_control_right_function(elemenet){
var step_size, margin_left, new_value, first_element, parent;
parent=elemenet.parent();
step_size=parent.find('.shortcode_slider_list').width();
margin_left=parseFloat(parent.find('.shortcode_slider_list').css('margin-left'), 10);
new_value=margin_left - 389;
parent.find('.shortcode_slider_list').animate({
'margin-left': new_value
}, 800, function (){
first_element=parent.find('.shortcode_slider_list li:nth-child(1)');
parent.find('.shortcode_slider_list li:nth-child(1)').remove();
parent.find('.shortcode_slider_list').append(first_element);
parent.find('.shortcode_slider_list').css('margin-left', 3 + 'px');
wpestate_restart_js_after_ajax();
});
}
$('.slider_control_left').on('click',function (){
wpestate_slider_control_left_function($(this));
});
$('.slider_control_right').on('click',function (){
wpestate_slider_control_right_function($(this));
});
$('.slider_container ').each(function(){
var element, wrapper;
element=$(this).find(".slider_control_right");
wrapper=$(this).find(".shortcode_slider_wrapper").attr('data-auto');
autoscroll_slider=parseFloat(wrapper, 10);
if(autoscroll_slider!==0){
setInterval(function (){
wpestate_slider_control_right_function(element);
}, autoscroll_slider);
}});
$('#login_user_topbar,#login_pwd_topbar').on('focus', function (e){
$('#user_menu_open').addClass('iosfixed');
});
$('#estate-carousel .slider-content h3 a,#estate-carousel .slider-content .read_more ').on('click',function (){
var new_link;
new_link=$(this).attr('href');
window.open(new_link, '_self', false);
});
$('#filter_city li').on('click',function (event){
event.preventDefault();
var pick, value_city, parent, selected_city, is_city, area_value;
value_city=String($(this).attr('data-value2')).toLowerCase();
$('#filter_area li').each(function (){
is_city=String($(this).attr('data-parentcity')).toLowerCase();
is_city=is_city.replace(" ", "-");
area_value=String($(this).attr('data-value')).toLowerCase();
if(is_city===value_city||value_city==='all'||is_city==='undefined'){
$(this).show();
}else{
$(this).hide();
}});
});
$('#sidebar_filter_city li').on('click',function (event){
event.preventDefault();
var pick, value_city, parent, selected_city, is_city, area_value;
value_city=String($(this).attr('data-value2')).toLowerCase();
$('#sidebar_filter_area li').each(function (){
is_city=String($(this).attr('data-parentcity')).toLowerCase();
is_city=is_city.replace(" ", "-");
area_value=String($(this).attr('data-value')).toLowerCase();
if(is_city===value_city||value_city==='all'){
$(this).show();
}else{
$(this).hide();
}});
});
$('#adv-search-city li').on('click',function (event){
event.preventDefault();
var pick, value_city, parent, selected_city, is_city, area_value;
value_city=String($(this).attr('data-value2')).toLowerCase();
$('#adv-search-area li').each(function (){
is_city=String($(this).attr('data-parentcity')).toLowerCase();
is_city=is_city.replace(" ", "-");
area_value=String($(this).attr('data-value')).toLowerCase();
if(is_city===value_city||value_city==='all'){
$(this).show();
}else{
$(this).hide();
}});
});
$('#property_city_submit').change(function (){
var city_value, area_value;
city_value=$(this).val();
all_browsers_stuff=$('#property_area_submit_hidden').html();
$('#property_area_submit').empty().append(all_browsers_stuff);
$('#property_area_submit option').each(function (){
area_value=$(this).attr('data-parentcity');
if(city_value===area_value||area_value==='all'){
}else{
$(this).remove();
}});
});
$('#adv_short_select_city li').on('click',function (event){
event.preventDefault();
var pick, value_city, parent, selected_city, is_city, area_value;
value_city=String($(this).attr('data-value2')).toLowerCase();
$('#adv_short_select_area li').each(function (){
is_city=String($(this).attr('data-parentcity')).toLowerCase();
is_city=is_city.replace(" ", "-");
area_value=String($(this).attr('data-value')).toLowerCase();
if(is_city===value_city||value_city==='all'){
$(this).show();
}else{
$(this).hide();
}});
});
$('#mobile-adv-city li').on('click',function (event){
event.preventDefault();
var pick, value_city, parent, selected_city, is_city, area_value;
value_city=String($(this).attr('data-value2')).toLowerCase();
$('#mobile-adv-area li').each(function (){
is_city=String($(this).attr('data-parentcity')).toLowerCase();
is_city=is_city.replace(" ", "-");
area_value=String($(this).attr('data-value')).toLowerCase();
if(is_city===value_city||value_city==='all'){
$(this).show();
}else{
$(this).hide();
}});
});
$('#adv-search-header-mobile').on('click',function (){
$('#adv-search-mobile').toggle('300');
});
$('.nav-prev,.nav-next ').on('click',function (event){
event.preventDefault();
var link=$(this).find('a').attr('href');
window.open(link, '_self', false);
});
$('.featured_agent_details_wrapper, .agent-listing-img-wrapper').on('click',function (){
var newl=$(this).attr('data-link');
window.open(newl, '_self', false);
});
$('.see_my_list_featured').on('click',function (event){
event.stopPropagation();
});
$('.featured_cover').on('click',function (){
var newl=$(this).attr('data-link');
window.open(newl, '_self', false);
});
jQuery(".agent_face").on("hover", function(event){
if(event.type==="mouseenter"){
$(this).find('.agent_face_details').fadeIn('500');
}else if(event.type==="mouseleave"){
$(this).find('.agent_face_details').fadeOut('500');
}});
$('.agent_unit, .blog_unit,.blog_unit_back,.places_wrapper ,.featured_agent,.places_slider_wrapper_type_1').on('click',function (){
var link;
link=$(this).attr('data-link');
window.open(link, '_self');
});
$('.property_listing').on('click',function (event){
var link, classevent;
classevent=$(event.target);
if(classevent.hasClass('carousel-control')||classevent.hasClass('icon-left-open-big')||classevent.hasClass('icon-right-open-big')){
return;
}
link=$(this).attr('data-link');
window.open(link, '_self');
});
jQuery('#imagelist i').on('click',function (){
var curent='';
jQuery(this).parent().remove();
jQuery('#imagelist .uploaded_images').each(function (){
curent=curent + ',' + jQuery(this).attr('data-imageid');
});
jQuery('#attachid').val(curent);
});
jQuery('#imagelist img').dblclick(function (){
jQuery('#imagelist .uploaded_images .thumber').each(function (){
jQuery(this).remove();
});
jQuery('.fa-star').remove();
jQuery(this).parent().append('
');
jQuery('#attachthumb').val(jQuery(this).parent().attr('data-imageid'));
});
$('.advanced_search_sidebar li').on('click',function (event){
event.preventDefault();
var pick, value, parent;
pick=$(this).text();
value=$(this).attr('data-value');
parent=$(this).parent().parent();
parent.find('.filter_menu_trigger').text(pick).append('').attr('data-value', value);
parent.find('input').val(value);
});
$('.adv-search-mobile li').on('click',function (event){
event.preventDefault();
var pick, value, parent;
pick=$(this).text();
value=$(this).attr('data-value');
parent=$(this).parent().parent();
parent.find('.filter_menu_trigger').text(pick).append('
').attr('data-value', value);
parent.find('input').val(value);
});
$('#switch').on('click',function (){
$('.main_wrapper').toggleClass('wide');
});
$('#accordion_prop_addr, #accordion_prop_details, #accordion_prop_features, #yelp_details').on('shown.bs.collapse', function (){
$(this).find('h4').removeClass('carusel_closed');
});
$('#accordion_prop_addr, #accordion_prop_details, #accordion_prop_features, #yelp_details').on('hidden.bs.collapse', function (){
$(this).find('h4').addClass('carusel_closed');
});
$('#adv-search-5 li,#adv-search-4 li,#adv-search-3 li,#adv-search-1 li,#advanced_search_shortcode li,#advanced_search_map_list li').on('click',function (){
var pick, value, parent;
pick=$(this).text();
value=$(this).attr('data-value');
parent=$(this).parent().parent();
parent.find('.filter_menu_trigger').text(pick).append('
').attr('data-value', value);
parent.find('input').val(value);
});
$('.advanced_search_map_list_container li').on('click',function (){
wpestate_start_filtering_ajax_map(1);
});
$('.advanced_search_map_list_container_trigger input[type="text"]').change(function (){
if($(this).attr('id')!=='search_location'&&$(this).attr('id')!=='check_in'){
wpestate_start_filtering_ajax_map(1);
}});
$('#check_out_list').change(function (){
var start_date=$('#check_in_list').val();
if(start_date!==''){
wpestate_start_filtering_ajax_map(1);
}});
$('#check_out_list').change(function (){
var start_date=$('#check_in_list').val();
if(start_date!==''){
wpestate_start_filtering_ajax_map(1);
}});
$('#extended_search_check_filter input[type="checkbox"]').on('click',function (){
wpestate_start_filtering_ajax_map(1);
});
$("#google_map_prop_list_sidebar #slider_price").slider({
stop: function (event, ui){
wprentals_show_pins();
wpestate_start_filtering_ajax_map(1);
}});
$('#showinpage,#showinpage_mobile').on('click',function (event){
event.preventDefault();
if($('#gmap-full').hasClass('spanselected')){
$('#gmap-full').trigger('click');
}
wpestate_start_filtering(1);
});
$('#openmap').on('click',function (){
if($(this).find('i').hasClass('fa-angle-down')){
$(this).empty().append('
' + control_vars.close_map);
if(control_vars.show_adv_search_map_close==='no'){
$('.search_wrapper').addClass('adv1_close');
adv_search_click();
}}else{
$(this).empty().append('
' + control_vars.open_map);
}
wpestate_new_open_close_map(2);
});
$('#gmap-full').on('click',function (){
if($('#gmap_wrapper').hasClass('fullmap')){
$('#gmap_wrapper').removeClass('fullmap').css('height', wrap_h + 'px');
$('#googleMap').removeClass('fullmap').css('height', map_h + 'px');
$('#search_wrapper').removeClass('fullscreen_search');
$('#search_wrapper').removeClass('fullscreen_search_open');
$('.master_header').removeClass('hidden');
$('#gmap-controls-wrapper ').removeClass('fullscreenon');
$('.content_wrapper,#colophon,#openmap').show();
$('#gmap-controls-wrapper ').removeClass('fullscreenon');
$('body,html').animate({
scrollTop: 0
}, "slow");
$('#openmap').show();
$(this).removeClass('spanselected');
}else{
wrap_h=$('#gmap_wrapper').outerHeight();
map_h=$('#googleMap').outerHeight();
$('#gmap_wrapper,#googleMap').css('height', '100%').addClass('fullmap');
$('#search_wrapper').addClass('fullscreen_search');
$('.master_header ').addClass('hidden');
$('.content_wrapper,#colophon,#openmap').hide();
$('#gmap-controls-wrapper ').addClass('fullscreenon');
$(this).addClass('spanselected');
}
if($('#google_map_prop_list_wrapper').hasClass('halfmapfull')){
$('#google_map_prop_list_wrapper').removeClass('halfmapfull');
$('#google_map_prop_list_wrapper').removeClass('halfmapfullx');
$('.master_header').removeClass('hidden');
$('#gmap-controls-wrapper ').removeClass('fullscreenon');
$(this).removeClass('spanselected');
}else{
$('#google_map_prop_list_wrapper').addClass('halfmapfull');
$('#google_map_prop_list_wrapper').addClass('halfmapfullx');
}
wprentals_map_resize();
});
$('#street-view').on('click',function (){
wpestate_toggleStreetView();
});
$('.videoitem iframe').on('click',function (){
$('.estate_video_control').remove();
});
jQuery(".icon-fav, .share_list, .compare-action, .dashboad-tooltip, .pack-name, .normal_list_no, .mess_tooltip").on("hover", function(event){
if(event.type==="mouseenter"){
$(this).tooltip('show');
}else if(event.type==="mouseleave"){
$(this).tooltip('hide');
}});
$('.share_list').on('click',function (event){
event.stopPropagation();
var sharediv=$(this).parent().find('.share_unit');
sharediv.toggle();
$(this).toggleClass('share_on');
});
$('.backtop').on('click',function (event){
event.preventDefault();
$('body,html').animate({
scrollTop: 0
}, "slow");
});
$(".fancybox-thumb").lazyload();
$(".fancybox-thumb").fancybox({
prevEffect:'none',
nextEffect:'none',
helpers:{
title:{
type: 'outside'
},
thumbs:{
width:100,
height:100
}}
});
$('#carousel-listing .item img').on('click',function (){
$("a[rel^='data-fancybox-thumb']:first").click();
});
$('.imagebody_new .image_gallery').on('click',function (){
$("a[rel^='data-fancybox-thumb']:first").click();
});
jQuery("#geolocation-button").on("hover", function(event){
if(event.type==="mouseenter"){
$('#tooltip-geolocation').fadeIn();
$('.tooltip').fadeOut("fast");
}else if(event.type==="mouseleave"){
$('#tooltip-geolocation').fadeOut();
}})
$('.extra_featured').change(function(){
var parent=$(this).parent();
var price_regular=parseFloat(parent.find('.submit-price-no').text(),10);
var price_featured=parseFloat(parent.find('.submit-price-featured').text(),10);
var total=price_regular+price_featured;
if($(this).is(':checked')){
parent.find('.submit-price-total').text(total);
parent.find('#stripe_form_featured').show();
parent.find('#stripe_form_simple').hide();
}else{
parent.find('.submit-price-total').text(price_regular);
parent.find('#stripe_form_featured').hide();
parent.find('#stripe_form_simple').show();
}
wpestate_enable_stripe_booking_prop();
});
$('.compare_wrapper').each(function (){
var cols=$(this).find('.compare_item_head').length;
$(this).addClass('compar-' + cols);
});
$('#list_view').on('click',function (){
$(this).toggleClass('icon_selected');
$('#listing_ajax_container').addClass('ajax12');
$('#grid_view').toggleClass('icon_selected');
$('.listing_wrapper').hide().removeClass('col-md-4').removeClass('col-md-3').addClass('col-md-12').fadeIn(400);
$('.the_grid_view').fadeOut(10, function (){
$('.the_list_view').fadeIn(300);
});
});
$('#grid_view').on('click',function (){
var class_type;
class_type=$('.listing_wrapper:first-of-type').attr('data-org');
$(this).toggleClass('icon_selected');
$('#listing_ajax_container').removeClass('ajax12');
$('#list_view').toggleClass('icon_selected');
$('.listing_wrapper').hide().removeClass('col-md-12').addClass('col-md-' + class_type).fadeIn(400);
$('.the_list_view').fadeOut(10, function (){
$('.the_grid_view').fadeIn(300);
});
});
$('#add-new-image').on('click',function (){
$('
New Image:
').appendTo('#files_area');
});
$('.delete_image').on('click',function (){
var image_id=$(this).attr('data-imageid');
curent=$('#images_todelete').val();
if(curent===''){
curent=image_id;
}else{
curent=curent + ',' + image_id;
}
$('#images_todelete').val(curent);
$(this).parent().remove();
});
$('#googleMap').bind('mousemove', function (e){
$('.tooltip').css({'top': e.pageY, 'left': e.pageX, 'z-index': '1'});
});
setTimeout(function (){
$('.tooltip').fadeOut("fast");
}, 10000);
});
function wpestate_show_capture(){
"use strict";
var position, slideno, slidedif, tomove, curentleft;
jQuery('#googleMapSlider').hide();
position=parseFloat(jQuery('#carousel-listing .carousel-inner .active').index(), 10);
jQuery('#carousel-listing .caption-wrapper span').removeClass('active');
jQuery("#carousel-listing .caption-wrapper span[data-slide-to='" + position + "'] ").addClass('active');
slideno=position + 1;
slidedif=slideno * 146;
if(slidedif > 810){
tomove=810 - slidedif;
jQuery('.post-carusel .carousel-indicators').css('left', tomove + "px");
}else{
position=jQuery('.post-carusel .carousel-indicators').css('left', tomove + "px").position();
curentleft=position.left;
if(curentleft < 0){
tomove=0;
jQuery('.post-carusel .carousel-indicators').css('left', tomove + "px");
}}
}
function wpestate_shortcode_google_map_load(containermap, lat, long, mapid){
"use strict";
var myCenter, mapOptions, map, marker;
myCenter=new google.maps.LatLng(lat, long);
mapOptions={
flat: false,
noClear: false,
zoom: 15,
scrollwheel: false,
draggable: true,
center: myCenter,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false,
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP]
},
disableDefaultUI: true,
gestureHandling: 'cooperative'
};
map=new google.maps.Map(document.getElementById(mapid), mapOptions);
google.maps.visualRefresh=true;
marker=new google.maps.Marker({
position: myCenter,
map: map
});
marker.setMap(map);
}
function wpestate_enable_stripe_booking_prop(){
jQuery('.wpestate_stripe_booking_prop').unbind();
jQuery('.wpestate_stripe_booking_prop').on('click',function(){
var parent=jQuery(this).parent();
var modalid=jQuery(this).attr('data-modalid');
jQuery('#'+modalid).show();
jQuery('#'+modalid+' .wpestate_stripe_form_1').show();
wpestate_start_stripe(0,modalid);
});
jQuery('.close_stripe_form').on('click',function(){
jQuery('.wpestate_stripe_form_wrapper').hide();
jQuery('.wpestate_stripe_form_1').hide();
});
};
window.addComment=function(s){var u,f,v,y=s.document,p={commentReplyClass:"comment-reply-link",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=s.MutationObserver||s.WebKitMutationObserver||s.MozMutationObserver,i="querySelector"in y&&"addEventListener"in s,n=!!y.documentElement.dataset;function t(){r(),function(){if(!e)return;new e(d).observe(y.body,{childList:!0,subtree:!0})}()}function r(e){if(i&&(u=I(p.cancelReplyId),f=I(p.commentFormId),u)){u.addEventListener("touchstart",a),u.addEventListener("click",a);var t=function(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return f.removeEventListener("keydown",t),e.preventDefault(),f.submit.click(),!1};f&&f.addEventListener("keydown",t);for(var n,r=function(e){var t,n=p.commentReplyClass;e&&e.childNodes||(e=y);t=y.getElementsByClassName?e.getElementsByClassName(n):e.querySelectorAll("."+n);return t}(e),d=0,o=r.length;d
=0},addClass:function(element,className){element.className+=" "+className},removeClass:function(element,className){var regex=new RegExp("\\b"+this.escapeRegExp(className)+"\\b");element.className=element.className.replace(regex,"")},interpolateString:function(str,callback){var marker=/{{([a-z][a-z0-9\-_]*)}}/gi;return str.replace(marker,function(matches){return callback(arguments[1])||""})},getCookie:function(name){var value="; "+document.cookie;var parts=value.split("; "+name+"=");return parts.length!=2?undefined:parts.pop().split(";").shift()},setCookie:function(name,value,expiryDays,domain,path){var exdate=new Date;exdate.setTime(exdate.getTime()+(expiryDays||365)*24*60*60*1e3);var cookie=[name+"="+value,"expires="+exdate.toGMTString(),"path="+(path||"/")];if(window.location.protocol==="https:"){cookie.push("secure=secure")}if(domain){cookie.push("domain="+domain)}document.cookie=cookie.join(";")},deepExtend:function(target,source){for(var prop in source){if(source.hasOwnProperty(prop)){if(prop in target&&this.isPlainObject(target[prop])&&this.isPlainObject(source[prop])){this.deepExtend(target[prop],source[prop])}else{target[prop]=source[prop]}}}return target},throttle:function(callback,limit){var wait=false;return function(){if(!wait){callback.apply(this,arguments);wait=true;setTimeout(function(){wait=false},limit)}}},hash:function(str){var hash=0,i,chr,len;if(str.length===0)return hash;for(i=0,len=str.length;i=128?"#000":"#fff"},getLuminance:function(hex){var num=parseInt(this.normaliseHex(hex),16),amt=38,R=(num>>16)+amt,B=(num>>8&255)+amt,G=(num&255)+amt;var newColour=(16777216+(R<255?R<1?0:R:255)*65536+(B<255?B<1?0:B:255)*256+(G<255?G<1?0:G:255)).toString(16).slice(1);return"#"+newColour},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isPlainObject:function(obj){return typeof obj==="object"&&obj!==null&&obj.constructor==Object}};cc.status={deny:"deny",allow:"allow",dismiss:"dismiss"};cc.transitionEnd=function(){var el=document.createElement("div");var trans={t:"transitionend",OT:"oTransitionEnd",msT:"MSTransitionEnd",MozT:"transitionend",WebkitT:"webkitTransitionEnd"};for(var prefix in trans){if(trans.hasOwnProperty(prefix)&&typeof el.style[prefix+"ransition"]!="undefined"){return trans[prefix]}}return""}();cc.hasTransition=!!cc.transitionEnd;var __allowedStatuses=Object.keys(cc.status).map(util.escapeRegExp);cc.customStyles={};cc.Popup=function(){var defaultOptions={enabled:true,container:null,cookie:{name:"cookieconsent_status",path:"/",domain:"",expiryDays:365},onPopupOpen:function(){},onPopupClose:function(){},onInitialise:function(status){},onStatusChange:function(status,chosenBefore){},onRevokeChoice:function(){},content:{header:"Cookies used on the website!",message:"This website uses cookies to ensure you get the best experience on our website.",dismiss:"Got it!",allow:"Allow cookies",deny:"Decline",link:"Learn more",href:"http://cookiesandyou.com",close:"❌"},elements:{header:' ',message:'{{message}} ',messagelink:'{{message}} {{link}} ',dismiss:'{{dismiss}} ',allow:'{{allow}} ',deny:'{{deny}} ',link:'{{link}} ',close:'{{close}} '},window:'\x3c!--googleoff: all--\x3e{{children}}\x3c!--googleon: all--\x3e
',revokeBtn:'Cookie Policy
',compliance:{info:'{{dismiss}}
',"opt-in":'{{dismiss}}{{allow}}
',"opt-out":'{{deny}}{{dismiss}}
'},type:"info",layouts:{basic:"{{messagelink}}{{compliance}}","basic-close":"{{messagelink}}{{compliance}}{{close}}","basic-header":"{{header}}{{message}}{{link}}{{compliance}}"},layout:"basic",position:"bottom",theme:"block",static:false,palette:null,revokable:false,animateRevokable:true,showLink:true,dismissOnScroll:false,dismissOnTimeout:false,autoOpen:true,autoAttach:true,whitelistPage:[],blacklistPage:[],overrideHTML:null};function CookiePopup(){this.initialise.apply(this,arguments)}CookiePopup.prototype.initialise=function(options){if(this.options){this.destroy()}util.deepExtend(this.options={},defaultOptions);if(util.isPlainObject(options)){util.deepExtend(this.options,options)}if(checkCallbackHooks.call(this)){this.options.enabled=false}if(arrayContainsMatches(this.options.blacklistPage,location.pathname)){this.options.enabled=false}if(arrayContainsMatches(this.options.whitelistPage,location.pathname)){this.options.enabled=true}var cookiePopup=this.options.window.replace("{{classes}}",getPopupClasses.call(this).join(" ")).replace("{{children}}",getPopupInnerMarkup.call(this));var customHTML=this.options.overrideHTML;if(typeof customHTML=="string"&&customHTML.length){cookiePopup=customHTML}if(this.options.static){var wrapper=appendMarkup.call(this,''+cookiePopup+"
");wrapper.style.display="";this.element=wrapper.firstChild;this.element.style.display="none";util.addClass(this.element,"cc-invisible")}else{this.element=appendMarkup.call(this,cookiePopup)}applyAutoDismiss.call(this);applyRevokeButton.call(this);if(this.options.autoOpen){this.autoOpen()}};CookiePopup.prototype.destroy=function(){if(this.onButtonClick&&this.element){this.element.removeEventListener("click",this.onButtonClick);this.onButtonClick=null}if(this.dismissTimeout){clearTimeout(this.dismissTimeout);this.dismissTimeout=null}if(this.onWindowScroll){window.removeEventListener("scroll",this.onWindowScroll);this.onWindowScroll=null}if(this.onMouseMove){window.removeEventListener("mousemove",this.onMouseMove);this.onMouseMove=null}if(this.element&&this.element.parentNode){this.element.parentNode.removeChild(this.element)}this.element=null;if(this.revokeBtn&&this.revokeBtn.parentNode){this.revokeBtn.parentNode.removeChild(this.revokeBtn)}this.revokeBtn=null;removeCustomStyle(this.options.palette);this.options=null};CookiePopup.prototype.open=function(callback){if(!this.element)return;if(!this.isOpen()){if(cc.hasTransition){this.fadeIn()}else{this.element.style.display=""}if(this.options.revokable){this.toggleRevokeButton()}this.options.onPopupOpen.call(this)}return this};CookiePopup.prototype.close=function(showRevoke){if(!this.element)return;if(this.isOpen()){if(cc.hasTransition){this.fadeOut()}else{this.element.style.display="none"}if(showRevoke&&this.options.revokable){this.toggleRevokeButton(true)}this.options.onPopupClose.call(this)}return this};CookiePopup.prototype.fadeIn=function(){var el=this.element;if(!cc.hasTransition||!el)return;if(this.afterTransition){afterFadeOut.call(this,el)}if(util.hasClass(el,"cc-invisible")){el.style.display="";if(this.options.static){var height=this.element.clientHeight;this.element.parentNode.style.maxHeight=height+"px"}var fadeInTimeout=20;this.openingTimeout=setTimeout(afterFadeIn.bind(this,el),fadeInTimeout)}};CookiePopup.prototype.fadeOut=function(){var el=this.element;if(!cc.hasTransition||!el)return;if(this.openingTimeout){clearTimeout(this.openingTimeout);afterFadeIn.bind(this,el)}if(!util.hasClass(el,"cc-invisible")){if(this.options.static){this.element.parentNode.style.maxHeight=""}this.afterTransition=afterFadeOut.bind(this,el);el.addEventListener(cc.transitionEnd,this.afterTransition);util.addClass(el,"cc-invisible")}};CookiePopup.prototype.isOpen=function(){return this.element&&this.element.style.display==""&&(cc.hasTransition?!util.hasClass(this.element,"cc-invisible"):true)};CookiePopup.prototype.toggleRevokeButton=function(show){if(this.revokeBtn)this.revokeBtn.style.display=show?"":"none"};CookiePopup.prototype.revokeChoice=function(preventOpen){this.options.enabled=true;this.clearStatus();this.options.onRevokeChoice.call(this);if(!preventOpen){this.autoOpen()}};CookiePopup.prototype.hasAnswered=function(options){return Object.keys(cc.status).indexOf(this.getStatus())>=0};CookiePopup.prototype.hasConsented=function(options){var val=this.getStatus();return val==cc.status.allow||val==cc.status.dismiss};CookiePopup.prototype.autoOpen=function(options){if(!this.hasAnswered()&&this.options.enabled){this.open()}else{if(this.options.revokable){this.toggleRevokeButton(true)}}};CookiePopup.prototype.setStatus=function(status){var c=this.options.cookie;var value=util.getCookie(c.name);var chosenBefore=Object.keys(cc.status).indexOf(value)>=0;if(Object.keys(cc.status).indexOf(status)>=0){util.setCookie(c.name,status,c.expiryDays,c.domain,c.path);this.options.onStatusChange.call(this,status,chosenBefore)}else{this.clearStatus()}};CookiePopup.prototype.getStatus=function(){return util.getCookie(this.options.cookie.name)};CookiePopup.prototype.clearStatus=function(){var c=this.options.cookie;util.setCookie(c.name,"",-1,c.domain,c.path)};function afterFadeIn(el){this.openingTimeout=null;util.removeClass(el,"cc-invisible")}function afterFadeOut(el){el.style.display="none";el.removeEventListener(cc.transitionEnd,this.afterTransition);this.afterTransition=null}function checkCallbackHooks(){var complete=this.options.onInitialise.bind(this);if(!window.navigator.cookieEnabled){complete(cc.status.deny);return true}if(window.CookiesOK||window.navigator.CookiesOK){complete(cc.status.allow);return true}var allowed=Object.keys(cc.status);var answer=this.getStatus();var match=allowed.indexOf(answer)>=0;if(match){complete(answer)}return match}function getPositionClasses(){var positions=this.options.position.split("-");var classes=[];positions.forEach(function(cur){classes.push("cc-"+cur)});return classes}function getPopupClasses(){var opts=this.options;var positionStyle=opts.position=="top"||opts.position=="bottom"?"banner":"floating";if(util.isMobile()){positionStyle="floating"}var classes=["cc-"+positionStyle,"cc-type-"+opts.type,"cc-theme-"+opts.theme];if(opts.static){classes.push("cc-static")}classes.push.apply(classes,getPositionClasses.call(this));var didAttach=attachCustomPalette.call(this,this.options.palette);if(this.customStyleSelector){classes.push(this.customStyleSelector)}return classes}function getPopupInnerMarkup(){var interpolated={};var opts=this.options;if(!opts.showLink){opts.elements.link="";opts.elements.messagelink=opts.elements.message}Object.keys(opts.elements).forEach(function(prop){interpolated[prop]=util.interpolateString(opts.elements[prop],function(name){var str=opts.content[name];return name&&typeof str=="string"&&str.length?str:""})});var complianceType=opts.compliance[opts.type];if(!complianceType){complianceType=opts.compliance.info}interpolated.compliance=util.interpolateString(complianceType,function(name){return interpolated[name]});var layout=opts.layouts[opts.layout];if(!layout){layout=opts.layouts.basic}return util.interpolateString(layout,function(match){return interpolated[match]})}function appendMarkup(markup){var opts=this.options;var div=document.createElement("div");var cont=opts.container&&opts.container.nodeType===1?opts.container:document.body;div.innerHTML=markup;var el=div.children[0];el.style.display="none";if(util.hasClass(el,"cc-window")&&cc.hasTransition){util.addClass(el,"cc-invisible")}this.onButtonClick=handleButtonClick.bind(this);el.addEventListener("click",this.onButtonClick);if(opts.autoAttach){if(!cont.firstChild){cont.appendChild(el)}else{cont.insertBefore(el,cont.firstChild)}}return el}function handleButtonClick(event){var targ=event.target;if(util.hasClass(targ,"cc-btn")){var matches=targ.className.match(new RegExp("\\bcc-("+__allowedStatuses.join("|")+")\\b"));var match=matches&&matches[1]||false;if(match){this.setStatus(match);this.close(true)}}if(util.hasClass(targ,"cc-close")){this.setStatus(cc.status.dismiss);this.close(true)}if(util.hasClass(targ,"cc-revoke")){this.revokeChoice()}}function attachCustomPalette(palette){var hash=util.hash(JSON.stringify(palette));var selector="cc-color-override-"+hash;var isValid=util.isPlainObject(palette);this.customStyleSelector=isValid?selector:null;if(isValid){addCustomStyle(hash,palette,"."+selector)}return isValid}function addCustomStyle(hash,palette,prefix){if(cc.customStyles[hash]){++cc.customStyles[hash].references;return}var colorStyles={};var popup=palette.popup;var button=palette.button;var highlight=palette.highlight;if(popup){popup.text=popup.text?popup.text:util.getContrast(popup.background);popup.link=popup.link?popup.link:popup.text;colorStyles[prefix+".cc-window"]=["color: "+popup.text,"background-color: "+popup.background];colorStyles[prefix+".cc-revoke"]=["color: "+popup.text,"background-color: "+popup.background];colorStyles[prefix+" .cc-link,"+prefix+" .cc-link:active,"+prefix+" .cc-link:visited"]=["color: "+popup.link];if(button){button.text=button.text?button.text:util.getContrast(button.background);button.border=button.border?button.border:"transparent";colorStyles[prefix+" .cc-btn"]=["color: "+button.text,"border-color: "+button.border,"background-color: "+button.background];if(button.background!="transparent")colorStyles[prefix+" .cc-btn:hover, "+prefix+" .cc-btn:focus"]=["background-color: "+getHoverColour(button.background)];if(highlight){highlight.text=highlight.text?highlight.text:util.getContrast(highlight.background);highlight.border=highlight.border?highlight.border:"transparent";colorStyles[prefix+" .cc-highlight .cc-btn:first-child"]=["border-color: "+highlight.border,"background-color: "+highlight.background]}else{colorStyles[prefix+" .cc-highlight .cc-btn:first-child"]=[]}}}var style=document.createElement("style");document.head.appendChild(style);cc.customStyles[hash]={references:1,element:style.sheet};var ruleIndex=-1;for(var prop in colorStyles){if(colorStyles.hasOwnProperty(prop)){style.sheet.insertRule(prop+"{"+colorStyles[prop].join(";")+"}",++ruleIndex)}}}function getHoverColour(hex){hex=util.normaliseHex(hex);if(hex=="000000"){return"#222"}return util.getLuminance(hex)}function removeCustomStyle(palette){if(util.isPlainObject(palette)){var hash=util.hash(JSON.stringify(palette));var customStyle=cc.customStyles[hash];if(customStyle&&!--customStyle.references){var styleNode=customStyle.element.ownerNode;if(styleNode&&styleNode.parentNode){styleNode.parentNode.removeChild(styleNode)}cc.customStyles[hash]=null}}}function arrayContainsMatches(array,search){for(var i=0,l=array.length;i=0){this.dismissTimeout=window.setTimeout(function(){setStatus(cc.status.dismiss)},Math.floor(delay))}var scrollRange=this.options.dismissOnScroll;if(typeof scrollRange=="number"&&scrollRange>=0){var onWindowScroll=function(evt){if(window.pageYOffset>Math.floor(scrollRange)){setStatus(cc.status.dismiss);window.removeEventListener("scroll",onWindowScroll);this.onWindowScroll=null}};this.onWindowScroll=onWindowScroll;window.addEventListener("scroll",onWindowScroll)}}function applyRevokeButton(){if(this.options.type!="info")this.options.revokable=true;if(util.isMobile())this.options.animateRevokable=false;if(this.options.revokable){var classes=getPositionClasses.call(this);if(this.options.animateRevokable){classes.push("cc-animate")}if(this.customStyleSelector){classes.push(this.customStyleSelector)}var revokeBtn=this.options.revokeBtn.replace("{{classes}}",classes.join(" "));this.revokeBtn=appendMarkup.call(this,revokeBtn);var btn=this.revokeBtn;if(this.options.animateRevokable){var wait=false;var onMouseMove=util.throttle(function(evt){var active=false;var minY=20;var maxY=window.innerHeight-20;if(util.hasClass(btn,"cc-top")&&evt.clientYmaxY)active=true;if(active){if(!util.hasClass(btn,"cc-active")){util.addClass(btn,"cc-active")}}else{if(util.hasClass(btn,"cc-active")){util.removeClass(btn,"cc-active")}}},200);this.onMouseMove=onMouseMove;window.addEventListener("mousemove",onMouseMove)}}}return CookiePopup}();cc.Location=function(){var defaultOptions={timeout:5e3,services:["freegeoip","ipinfo","maxmind"],serviceDefinitions:{freegeoip:function(){return{url:"//freegeoip.net/json/?callback={callback}",isScript:true,callback:function(done,response){try{var json=JSON.parse(response);return json.error?toError(json):{code:json.country_code}}catch(err){return toError({error:"Invalid response ("+err+")"})}}}},ipinfo:function(){return{url:"//ipinfo.io",headers:["Accept: application/json"],callback:function(done,response){try{var json=JSON.parse(response);return json.error?toError(json):{code:json.country}}catch(err){return toError({error:"Invalid response ("+err+")"})}}}},ipinfodb:function(options){return{url:"//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}",isScript:true,callback:function(done,response){try{var json=JSON.parse(response);return json.statusCode=="ERROR"?toError({error:json.statusMessage}):{code:json.countryCode}}catch(err){return toError({error:"Invalid response ("+err+")"})}}}},maxmind:function(){return{url:"//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js",isScript:true,callback:function(done){if(!window.geoip2){done(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope"));return}geoip2.country(function(location){try{done({code:location.country.iso_code})}catch(err){done(toError(err))}},function(err){done(toError(err))})}}}}};function Location(options){util.deepExtend(this.options={},defaultOptions);if(util.isPlainObject(options)){util.deepExtend(this.options,options)}this.currentServiceIndex=-1}Location.prototype.getNextService=function(){var service;do{service=this.getServiceByIdx(++this.currentServiceIndex)}while(this.currentServiceIndex3){onComplete(xhr)}}}xhr.send(postData)}function toError(obj){return new Error("Error ["+(obj.code||"UNKNOWN")+"]: "+obj.error)}return Location}();cc.Law=function(){var defaultOptions={regionalLaw:true,hasLaw:["AT","BE","BG","HR","CZ","CY","DK","EE","FI","FR","DE","EL","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","SK","SI","ES","SE","GB","UK"],revokable:["HR","CY","DK","EE","FR","DE","LV","LT","NL","PT","ES"],explicitAction:["HR","IT","ES"]};function Law(options){this.initialise.apply(this,arguments)}Law.prototype.initialise=function(options){util.deepExtend(this.options={},defaultOptions);if(util.isPlainObject(options)){util.deepExtend(this.options,options)}};Law.prototype.get=function(countryCode){var opts=this.options;return{hasLaw:opts.hasLaw.indexOf(countryCode)>=0,revokable:opts.revokable.indexOf(countryCode)>=0,explicitAction:opts.explicitAction.indexOf(countryCode)>=0}};Law.prototype.applyLaw=function(options,countryCode){var country=this.get(countryCode);if(!country.hasLaw){options.enabled=false}if(this.options.regionalLaw){if(country.revokable){options.revokable=true}if(country.explicitAction){options.dismissOnScroll=false;options.dismissOnTimeout=false}}return options};return Law}();cc.initialise=function(options,complete,error){var law=new cc.Law(options.law);if(!complete)complete=function(){};if(!error)error=function(){};cc.getCountryCode(options,function(result){delete options.law;delete options.location;if(result.code){options=law.applyLaw(options,result.code)}complete(new cc.Popup(options))},function(err){delete options.law;delete options.location;error(err,new cc.Popup(options))})};cc.getCountryCode=function(options,complete,error){if(options.law&&options.law.countryCode){complete({code:options.law.countryCode});return}if(options.location){var locator=new cc.Location(options.location);locator.locate(function(serviceResult){complete(serviceResult||{})},error);return}complete({})};cc.utils=util;cc.hasInitialised=true;window.cookieconsent=cc})(window.cookieconsent||{});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["postscribe"]=e():t["postscribe"]=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={"exports":{},"id":n,"loaded":!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var o=r(1),i=n(o);t.exports=i["default"]},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(){}function a(){var t=m.shift();if(t){var e=h.last(t);e.afterDequeue(),t.stream=s.apply(void 0,t),e.afterStreamStart()}}function s(t,e,r){function n(t){t=r.beforeWrite(t),g.write(t),r.afterWrite(t)}g=new p["default"](t,r),g.id=y++,g.name=r.name||g.id,u.streams[g.name]=g;var o=t.ownerDocument,s={"close":o.close,"open":o.open,"write":o.write,"writeln":o.writeln};c(o,{"close":i,"open":i,"write":function(){for(var t=arguments.length,e=Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:null,n=d+e;f.existy(r)&&""!==r?t.setAttribute(n,r):t.removeAttribute(n)}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.root=e,this.options=r,this.doc=e.ownerDocument,this.win=this.doc.defaultView||this.doc.parentWindow,this.parser=new l["default"]("",{"autoFix":r.autoFix}),this.actuals=[e],this.proxyHistory="",this.proxyRoot=this.doc.createElement(e.nodeName),this.scriptStack=[],this.writeQueue=[],s(this.proxyRoot,"proxyof",0)}return t.prototype.write=function(){var t;for((t=this.writeQueue).push.apply(t,arguments);!this.deferredRemote&&this.writeQueue.length;){var e=this.writeQueue.shift();f.isFunction(e)?this._callFunction(e):this._writeImpl(e)}},t.prototype._callFunction=function(t){var e={"type":"function","value":t.name||t.toString()};this._onScriptStart(e),t.call(this.win,this.doc),this._onScriptDone(e)},t.prototype._writeImpl=function(t){this.parser.append(t);for(var e=void 0,r=void 0,n=void 0,o=[];(e=this.parser.readToken())&&!(r=f.isScript(e))&&!(n=f.isStyle(e));)e=this.options.beforeWriteToken(e),e&&o.push(e);o.length>0&&this._writeStaticTokens(o),r&&this._handleScriptToken(e),n&&this._handleStyleToken(e)},t.prototype._writeStaticTokens=function(t){var e=this._buildChunk(t);return e.actual?(e.html=this.proxyHistory+e.actual,this.proxyHistory+=e.proxy,this.proxyRoot.innerHTML=e.html,h&&(e.proxyInnerHTML=this.proxyRoot.innerHTML),this._walkChunk(),h&&(e.actualInnerHTML=this.root.innerHTML),e):null},t.prototype._buildChunk=function(t){for(var e=this.actuals.length,r=[],n=[],o=[],i=t.length,a=0;a)/," "+d+"id="+c+" $1")),s.attrs.id!==m&&s.attrs.id!==y&&o.push("atomicTag"===s.type?"":"<"+s.tagName+" "+d+"proxyof="+c+(s.unary?" />":">"))}}else n.push(u),o.push("endTag"===s.type?u:"")}return{"tokens":t,"raw":r.join(""),"actual":n.join(""),"proxy":o.join("")}},t.prototype._walkChunk=function(){for(var t=void 0,e=[this.proxyRoot];f.existy(t=e.shift());){var r=1===t.nodeType,n=r&&a(t,"proxyof");if(!n){r&&(this.actuals[a(t,"id")]=t,s(t,"id"));var o=t.parentNode&&a(t.parentNode,"proxyof");o&&this.actuals[o].appendChild(t)}e.unshift.apply(e,f.toArray(t.childNodes))}},t.prototype._handleScriptToken=function(t){var e=this,r=this.parser.clear();r&&this.writeQueue.unshift(r),t.src=t.attrs.src||t.attrs.SRC,t=this.options.beforeWriteToken(t),t&&(t.src&&this.scriptStack.length?this.deferredRemote=t:this._onScriptStart(t),this._writeScriptToken(t,function(){e._onScriptDone(t)}))},t.prototype._handleStyleToken=function(t){var e=this.parser.clear();e&&this.writeQueue.unshift(e),t.type=t.attrs.type||t.attrs.TYPE||"text/css",t=this.options.beforeWriteToken(t),t&&this._writeStyleToken(t),e&&this.write()},t.prototype._writeStyleToken=function(t){var e=this._buildStyle(t);this._insertCursor(e,y),t.content&&(e.styleSheet&&!e.sheet?e.styleSheet.cssText=t.content:e.appendChild(this.doc.createTextNode(t.content)))},t.prototype._buildStyle=function(t){var e=this.doc.createElement(t.tagName);return e.setAttribute("type",t.type),f.eachKey(t.attrs,function(t,r){e.setAttribute(t,r)}),e},t.prototype._insertCursor=function(t,e){this._writeImpl(' ');var r=this.doc.getElementById(e);r&&r.parentNode.replaceChild(t,r)},t.prototype._onScriptStart=function(t){t.outerWrites=this.writeQueue,this.writeQueue=[],this.scriptStack.unshift(t)},t.prototype._onScriptDone=function(t){return t!==this.scriptStack[0]?void this.options.error({"msg":"Bad script nesting or script finished twice"}):(this.scriptStack.shift(),this.write.apply(this,t.outerWrites),void(!this.scriptStack.length&&this.deferredRemote&&(this._onScriptStart(this.deferredRemote),this.deferredRemote=null)))},t.prototype._writeScriptToken=function(t,e){var r=this._buildScript(t),n=this._shouldRelease(r),o=this.options.afterAsync;t.src&&(r.src=t.src,this._scriptLoadHandler(r,n?o:function(){e(),o()}));try{this._insertCursor(r,m),r.src&&!n||e()}catch(t){this.options.error(t),e()}},t.prototype._buildScript=function(t){var e=this.doc.createElement(t.tagName);return f.eachKey(t.attrs,function(t,r){e.setAttribute(t,r)}),t.content&&(e.text=t.content),e},t.prototype._scriptLoadHandler=function(t,e){function r(){t=t.onload=t.onreadystatechange=t.onerror=null}function n(){r(),null!=e&&e(),e=null}function o(t){r(),a(t),null!=e&&e(),e=null}function i(t,e){var r=t["on"+e];null!=r&&(t["_on"+e]=r)}var a=this.options.error;i(t,"load"),i(t,"error"),u(t,{"onload":function(){if(t._onload)try{t._onload.apply(this,Array.prototype.slice.call(arguments,0))}catch(e){o({"msg":"onload handler failed "+e+" @ "+t.src})}n()},"onerror":function(){if(t._onerror)try{t._onerror.apply(this,Array.prototype.slice.call(arguments,0))}catch(e){return void o({"msg":"onerror handler failed "+e+" @ "+t.src})}o({"msg":"remote script failed "+t.src})},"onreadystatechange":function(){/^(loaded|complete)$/.test(t.readyState)&&n()}})},t.prototype._shouldRelease=function(t){var e=/^script$/i.test(t.nodeName);return!e||!!(this.options.releaseAsync&&t.src&&t.hasAttribute("async"))},t}();e["default"]=g},function(t,e,r){!function(e,r){t.exports=r()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={"exports":{},"id":n,"loaded":!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var o=r(1),i=n(o);t.exports=i["default"]},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var a=r(2),s=o(a),u=r(3),c=o(u),l=r(6),p=n(l),f=r(5),h={"comment":/^");if(e>=0)return new c.CommentToken(t.substr(4,e-1),e+3)}function o(t){var e=t.indexOf("<");return new c.CharsToken(e>=0?e:t.length)}function i(t){var e=t.indexOf(">");if(e!==-1){var r=t.match(l.startTag);if(r){var n=function(){var t={},e={},n=r[2];return r[2].replace(l.attr,function(r,o){arguments[2]||arguments[3]||arguments[4]||arguments[5]?arguments[5]?(t[arguments[5]]="",e[arguments[5]]=!0):t[o]=arguments[2]||arguments[3]||arguments[4]||l.fillAttr.test(o)&&o||"":t[o]="",n=n.replace(r,"")}),{"v":new c.StartTagToken(r[1],r[0].length,t,e,(!!r[3]),n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))}}();if("object"===("undefined"==typeof n?"undefined":u(n)))return n.v}}}function a(t){var e=i(t);if(e){var r=t.slice(e.length);if(r.match(new RegExp("\\s*"+e.tagName+"\\s*>","i"))){var n=r.match(new RegExp("([\\s\\S]*?)\\s*"+e.tagName+"\\s*>","i"));if(n)return new c.AtomicTagToken(e.tagName,n[0].length+e.length,e.attrs,e.booleanAttrs,n[1])}}}function s(t){var e=t.match(l.endTag);if(e)return new c.EndTagToken(e[1],e[0].length)}e.__esModule=!0;var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.comment=n,e.chars=o,e.startTag=i,e.atomicTag=a,e.endTag=s;var c=r(4),l={"startTag":/^<([\-A-Za-z0-9_]+)((?:\s+[\w\-]+(?:\s*=?\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,"endTag":/^<\/([\-A-Za-z0-9_]+)[^>]*>/,"attr":/(?:([\-A-Za-z0-9_]+)\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))|(?:([\-A-Za-z0-9_]+)(\s|$)+)/g,"fillAttr":/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i}},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0,e.EndTagToken=e.AtomicTagToken=e.StartTagToken=e.TagToken=e.CharsToken=e.CommentToken=e.Token=void 0;var o=r(5),i=(e.Token=function t(e,r){n(this,t),this.type=e,this.length=r,this.text=""},e.CommentToken=function(){function t(e,r){n(this,t),this.type="comment",this.length=r||(e?e.length:0),this.text="",this.content=e}return t.prototype.toString=function(){return"